From 06fc494d035fb9c0d9d341a5d25b00fb44fae379 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 23 Sep 2016 18:25:46 +0200 Subject: [PATCH] Remove crufty code --- ethcore/src/miner/transaction_queue.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ethcore/src/miner/transaction_queue.rs b/ethcore/src/miner/transaction_queue.rs index 92c92a5f5..d870637ef 100644 --- a/ethcore/src/miner/transaction_queue.rs +++ b/ethcore/src/miner/transaction_queue.rs @@ -615,12 +615,10 @@ impl TransactionQueue { /// to avoid breaking invariants in queue (ordered by nonces). /// Consecutive transactions from this sender would fail otherwise (because of invalid nonce). pub fn penalize(&mut self, transaction_hash: &H256) { - let transaction = self.by_hash.get(transaction_hash); - if transaction.is_none() { - return; - } - - let transaction = transaction.expect("Early-exit for None is above."); + let transaction = match self.by_hash.get(transaction_hash) { + None => return, + Some(t) => t, + }; let sender = transaction.sender(); // Penalize all transactions from this sender