Fix for async miner loop not resetting head (#877)

This commit is contained in:
Ignotus Peverell
2018-03-27 08:22:11 +00:00
committed by Yeastplume
parent b9b6954d02
commit 77e63f3e3f
+4 -2
View File
@@ -132,7 +132,7 @@ impl Miner {
b: &mut Block,
cuckoo_size: u32,
head: &BlockHeader,
latest_hash: &Hash,
latest_hash: &mut Hash,
attempt_time_per_block: u32,
mining_stats: Arc<RwLock<MiningStats>>,
) -> Option<Proof> {
@@ -235,6 +235,8 @@ impl Miner {
}
// avoid busy wait
thread::sleep(Duration::from_millis(100));
*latest_hash = self.chain.head().unwrap().last_block_h;
}
if sol == None {
debug!(
@@ -529,7 +531,7 @@ impl Miner {
&mut b,
cuckoo_size,
&head,
&latest_hash,
&mut latest_hash,
miner_config.attempt_time_per_block,
mining_stats.clone(),
);