From 40ac01b7304738f9089ec64f2dd4ac03cf10995e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 15 Mar 2016 10:54:19 +0100 Subject: [PATCH] Fixing possible race in transaction queue --- miner/src/transaction_queue.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/miner/src/transaction_queue.rs b/miner/src/transaction_queue.rs index 880c73750..324a46364 100644 --- a/miner/src/transaction_queue.rs +++ b/miner/src/transaction_queue.rs @@ -516,11 +516,10 @@ impl TransactionQueue { return; } - let base_nonce = fetch_nonce(&address); - Self::replace_transaction(tx, base_nonce, &mut self.current, &mut self.by_hash); + Self::replace_transaction(tx, state_nonce, &mut self.current, &mut self.by_hash); self.last_nonces.insert(address, nonce); // But maybe there are some more items waiting in future? - self.move_matching_future_to_current(address, nonce + U256::one(), base_nonce); + self.move_matching_future_to_current(address, nonce + U256::one(), state_nonce); self.current.enforce_limit(&mut self.by_hash); }