Added a decent reaction to a new block in chain in mining process.

This commit is contained in:
Revertron
2021-03-16 18:16:31 +01:00
parent ffd70c92a6
commit 96ec25c0d0
5 changed files with 46 additions and 12 deletions
+1 -1
View File
@@ -370,7 +370,7 @@ fn handle_message(context: Arc<Mutex<Context>>, message: Message, peers: &mut Pe
BlockQuality::Good => {
context.chain.add_block(block);
let my_height = context.chain.height();
context.bus.post(crate::event::Event::BlockchainChanged);
context.bus.post(crate::event::Event::BlockchainChanged { index: my_height });
// If it was the last block to sync
if my_height == max_height {
context.bus.post(crate::event::Event::SyncFinished);