Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Next nonce RPC #2917

Merged
merged 1 commit into from Oct 27, 2016
Merged

Next nonce RPC #2917

merged 1 commit into from Oct 27, 2016

Conversation

tomusdrw
Copy link
Collaborator

Closes #2916
Related #2908

@tomusdrw tomusdrw added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Oct 27, 2016

Ok(miner.last_nonce(&address)
.map(|n| n + 1.into())
.unwrap_or_else(|| client.latest_nonce(&address))
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it latest_nonce + 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

latest_nonce in client is actually returning the a nonce for next transaction (i.e. it returns 0x0 when there are no transactions yet)
miner.last_nonce returns last nonce of transactions transaction queue so we need to add one before returning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants