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

Get pending txs too in tx count, hopefully will alleviate some nonce … #173

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/polyswarmd/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def get_syncing():
@chain
def get_nonce():
account = g.chain.w3.toChecksumAddress(g.eth_address)

return success(g.chain.w3.eth.getTransactionCount(account))
return success(g.chain.w3.eth.getTransactionCount(account, 'pending'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've tried using pending like this and it wasn't able to get pending nonces. But, we can try it and see. 🤞 There're are few related issues:

ethereum/go-ethereum#2880
https://ethereum.stackexchange.com/questions/6496/gettransactioncount-with-pending-not-working

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's been my experience as well, but I think it's "more correct" this way. Thanks for review

Also gonna try addressing on client-side by tweaking the nonce resync logic



@misc.route('/transactions', methods=['POST'])
Expand Down