Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function sendTransactions(txs, txClient, timeoutLimit){
try{
const hashes = txs.map(x => txHelper.hash(x));
const txList = txHelper.createTxListFromArray(txs);
let p = new Promise((resolve, reject) => {
const timer = setTimeout(()=>{
txClient.$channel.close();
reject(new Error('Please check IP address OR your internet connection'));
}, timeoutLimit);
txClient.listTorii(txList, (err) => {
clearTimeout(timer);
if(err) {
return reject(err);
}
resolve();
});
});
await p;
return hashes;
}catch(e){