Open raucao opened 5 years ago
can we do a eth_gettransactioncount on boot or regularly, store that number and then manually increment the nonce everytime we've sent a transaction?
something like (pseudo code):
let nonce = await provider.getTransactionCount('pending');
nonce++;
[contirbution1, contribution2].forEach(c => {
await kredits.Contribution.add(attrs, {nonce});
nonce++;
})
we could maybe use ether.js's waitForTransaction
to wait until the transaction is mined and then increment the nonce (or do a provider.getTransactionCount('pending')
again) and then do the next transaction.
See dcbce66796669c96d931a70f0f2e3ba52437af31 for hotfix that doesn't really fix the underlying issue with ethers.js' wallet nonce management.