From d91e8ccd34b2b6938e569ef1c9c25b16f922bc5c Mon Sep 17 00:00:00 2001 From: Arkadiy Paronyan Date: Fri, 1 Jul 2016 20:38:37 +0200 Subject: [PATCH] Save the block reference in the queue on notification (#1501) --- ethcore/src/miner/miner.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index d3e32c797..40254b8c2 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -265,6 +265,10 @@ impl Miner { let difficulty = *block.block().fields().header.difficulty(); let is_new = original_work_hash.map_or(true, |h| block.block().fields().header.hash() != h); sealing_work.push(block); + // If push notifications are enabled we assume all work items are used. + if self.work_poster.is_some() && is_new { + sealing_work.use_last_ref(); + } (Some((pow_hash, difficulty, number)), is_new) } else { (None, false)