Save the block reference in the queue on notification (#1501)
This commit is contained in:
parent
789b903de6
commit
d91e8ccd34
@ -265,6 +265,10 @@ impl Miner {
|
|||||||
let difficulty = *block.block().fields().header.difficulty();
|
let difficulty = *block.block().fields().header.difficulty();
|
||||||
let is_new = original_work_hash.map_or(true, |h| block.block().fields().header.hash() != h);
|
let is_new = original_work_hash.map_or(true, |h| block.block().fields().header.hash() != h);
|
||||||
sealing_work.push(block);
|
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)
|
(Some((pow_hash, difficulty, number)), is_new)
|
||||||
} else {
|
} else {
|
||||||
(None, false)
|
(None, false)
|
||||||
|
Loading…
Reference in New Issue
Block a user