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

How does MyEtherWallet calculate the correct transaction nonce? #133

Closed
tarekskr opened this issue Oct 18, 2018 · 4 comments
Closed

How does MyEtherWallet calculate the correct transaction nonce? #133

tarekskr opened this issue Oct 18, 2018 · 4 comments

Comments

@tarekskr
Copy link

How does MyEtherWallet calculate the correct transaction nonce (including pending transactions) when multiple transactions are being issued?

It's well known that eth_getTransactionCount does not return the correct number of pending transactions, so I was wondering how you guys do it. Could be really beneficial for the community to learn from.

@gamalielhere
Copy link
Contributor

@tarekskr Currently we use the eth.getTransactionCount. Since users can interact with the chain outside of MEW, we have to depend on the latest txcount on the chain. We might add a cacher and an automatic nonce incrementing function in the future but this has not been implemented yet.

@tarekskr
Copy link
Author

Thanks @gamalielhere . The only problem with only using eth.getTransactionCount is that it will currently return the wrong number of transactions if the user has any pending transactions at the time they use MEW to post a new tx.

@gamalielhere
Copy link
Contributor

@tarekskr We are aware of that. But then again, users might have different activities outside of MEW, so we have no way to accurately estimate nonces. As mentioned above, we are looking to implement a cache system to keep track of nonces.

@gamalielhere
Copy link
Contributor

Closing this issue. Let me know if you need anything else.

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

No branches or pull requests

2 participants