Fixed small bug and test.
This commit is contained in:
@@ -188,6 +188,9 @@ impl Miner {
|
|||||||
error!("To mine genesis block you need to make 'origin' an empty string in config.");
|
error!("To mine genesis block you need to make 'origin' an empty string in config.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if block.index == 1 {
|
||||||
|
context.settings.origin = block.hash.to_string();
|
||||||
|
}
|
||||||
context.chain.add_block(block);
|
context.chain.add_block(block);
|
||||||
}
|
}
|
||||||
context.bus.post(Event::MinerStopped);
|
context.bus.post(Event::MinerStopped);
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
let bus2 = bus.clone();
|
let bus2 = bus.clone();
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
bus2.lock().unwrap().post(Event::BlockchainChanged);
|
bus2.lock().unwrap().post(Event::BlockchainChanged { index: 1 });
|
||||||
});
|
});
|
||||||
|
|
||||||
let guard = string.lock().unwrap();
|
let guard = string.lock().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user