@@ -389,6 +389,7 @@ async function waitForBalance(web3, address, minBalance, updateProgress) {
389389 });
390390}
391391
392+//TODO replace with txn.sendSignedTransaction? it can doubt nonce errors too
392393async function sendAndAwaitConfirm(web3, signedTxs) {
393394 await Promise.all(signedTxs.map(tx => {
394395 console.log('sending...');
@@ -403,8 +404,7 @@ async function sendAndAwaitConfirm(web3, signedTxs) {
403404 // this is really only the case in local dev environments.
404405 const txHash = web3.utils.keccak256(tx);
405406 console.log(err.message);
406− if (err.message.slice(0,54) ===
407− "Returned error: the tx doesn't have the correct nonce.") {
407+ if (err.message.includes("the tx doesn't have the correct nonce.")) {
408408 console.log('nonce error, awaiting confirm', err.message.slice(55));
409409 //TODO max wait time before assume failure?
410410 let res = await waitForTransactionConfirm(web3, txHash);