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

Fix nonce reservation #7025

Merged
merged 5 commits into from
Nov 14, 2017
Merged

Fix nonce reservation #7025

merged 5 commits into from
Nov 14, 2017

Conversation

tomusdrw
Copy link
Collaborator

Kudos to @ngotchac

@tomusdrw tomusdrw added A0-pleasereview 🤓 Pull request needs code review. M6-rpcapi 📣 RPC API. labels Nov 12, 2017
@5chdn
Copy link
Contributor

5chdn commented Nov 13, 2017

Does this require a patch?

@5chdn 5chdn added this to the 1.9 milestone Nov 13, 2017
@tomusdrw
Copy link
Collaborator Author

#6834 wasn't backported, so no.

/// The reserved nonce cannot be smaller than the minimal nonce.
pub fn reserve(&mut self, sender: Address, minimal: U256) -> Reserved {
if self.nonces.len() + 1 > Self::CLEAN_AT {
let to_remove = self.nonces.iter().filter(|&(_, v)| v.is_empty()).map(|(k, _)| *k).collect::<Vec<_>>();
Copy link
Contributor

Choose a reason for hiding this comment

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

HashMap::retain

@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Nov 13, 2017
@debris debris merged commit dd7177d into master Nov 14, 2017
@debris debris deleted the fix-nonce-reservation branch November 14, 2017 12:44
tomusdrw pushed a commit that referenced this pull request Jan 3, 2018
5chdn pushed a commit that referenced this pull request Jan 9, 2018
* Reserve nonces for signing (#6834)

* Nonce future - reserve and dispatch

* Single thread nonce tests

* Track status of reserved nonces.

* Initialization of nonce reservations.

* Prospective Signer

* Fix cli tests.

* Merge pull request #7025 from paritytech/fix-nonce-reservation

Fix nonce reservation

* Fix build.
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. M6-rpcapi 📣 RPC API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants