Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Properly manage transaction nonces #28

Open
raucao opened this issue Apr 6, 2019 · 2 comments
Open

Properly manage transaction nonces #28

raucao opened this issue Apr 6, 2019 · 2 comments
Labels

Comments

@raucao
Copy link
Member

raucao commented Apr 6, 2019

See dcbce66 for hotfix that doesn't really fix the underlying issue with ethers.js' wallet nonce management.

@bumi
Copy link
Contributor

bumi commented Apr 6, 2019

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++;
})

@bumi
Copy link
Contributor

bumi commented Apr 6, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants