Fixed block checking code. Optimized build.rs.

This commit is contained in:
Revertron
2021-04-19 15:31:05 +02:00
parent 9ca952ee67
commit 078781a6da
3 changed files with 17 additions and 5 deletions
+3 -1
View File
@@ -754,8 +754,10 @@ impl Chain {
Twin
};
}
} else if block.prev_block_hash != last_block.hash {
warn!("Ignoring block with wrong previous hash:\n{:?}", &block);
return Bad;
}
}
}
+1 -1
View File
@@ -509,7 +509,7 @@ fn process_new_block(context: Arc<Mutex<Context>>, peers: &mut Peers, token: &To
BlockQuality::Future => { debug!("Ignoring future block {}", block.index); }
BlockQuality::Bad => {
// TODO save bad public keys to banned table
debug!("Ignoring bad block {} with hash {:?}", block.index, block.hash);
debug!("Ignoring bad block {} with hash {:?} from {}", block.index, block.hash, peer.get_addr());
let height = context.chain.height();
context.chain.update_max_height(height);
context.bus.post(crate::event::Event::SyncFinished);