Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants