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