Optimized signing blocks scheduler.
This commit is contained in:
@@ -492,10 +492,6 @@ fn process_new_block(context: Arc<Mutex<Context>>, peers: &mut Peers, token: &To
|
||||
match context.chain.check_new_block(&block) {
|
||||
BlockQuality::Good => {
|
||||
context.chain.add_block(block);
|
||||
let keystore = context.keystore.clone();
|
||||
if let Some(event) = context.chain.update(&keystore) {
|
||||
context.bus.post(event);
|
||||
}
|
||||
let my_height = context.chain.height();
|
||||
context.bus.post(crate::event::Event::BlockchainChanged { index: my_height });
|
||||
// If it was the last block to sync
|
||||
@@ -521,10 +517,6 @@ fn process_new_block(context: Arc<Mutex<Context>>, peers: &mut Peers, token: &To
|
||||
let last_block = context.chain.last_block().unwrap();
|
||||
if block.is_better_than(&last_block) {
|
||||
context.chain.replace_block(block.index, block).expect("Error replacing block with fork");
|
||||
let keystore = context.keystore.clone();
|
||||
if let Some(event) = context.chain.update(&keystore) {
|
||||
context.bus.post(event);
|
||||
}
|
||||
let index = context.chain.height();
|
||||
context.bus.post(crate::event::Event::BlockchainChanged { index });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user