From 97fcd60e569850890b24e96649595f5f73228b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Fri, 23 Sep 2016 19:42:53 +0200 Subject: [PATCH] saturating add Conflicts: ethcore/src/miner/transaction_queue.rs --- ethcore/src/miner/transaction_queue.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ethcore/src/miner/transaction_queue.rs b/ethcore/src/miner/transaction_queue.rs index d870637ef..7db65eacb 100644 --- a/ethcore/src/miner/transaction_queue.rs +++ b/ethcore/src/miner/transaction_queue.rs @@ -156,11 +156,7 @@ impl TransactionOrder { } fn penalize(mut self) -> Self { - let current = self.penalties; - self.penalties = match self.penalties.saturating_add(1) { - (_, true) => current, - (val, false) => val, - }; + self.penalties = self.penalties.saturating_add(1); self } } @@ -404,7 +400,7 @@ pub struct AccountDetails { } /// Transactions with `gas > (gas_limit + gas_limit * Factor(in percents))` are not imported to the queue. -const GAS_LIMIT_HYSTERESIS: usize = 10; // % +const GAS_LIMIT_HYSTERESIS: usize = 10; // (100/GAS_LIMIT_HYSTERESIS) % /// `TransactionQueue` implementation pub struct TransactionQueue {