Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into journaldb
Browse files Browse the repository at this point in the history
  • Loading branch information
gavofyork committed Mar 2, 2016
2 parents 8ecd7d8 + 13deb4f commit b70dff4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ethcore/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ impl Client {
let engine = self.engine.deref().deref();
let header = &block.header;

// Check the block isn't so old we won't be able to enact it.
let best_block_number = self.chain.read().unwrap().best_block_number();
debug!("Best: {}, importing: {}", best_block_number, header.number());
if header.number() <= best_block_number - HISTORY {
warn!(target: "client", "Block import failed for #{} ({})\nBlock is ancient (current best block: #{}).", header.number(), header.hash(), best_block_number);
return Err(());
}

// Verify Block Family
let verify_family_result = verify_block_family(&header, &block.bytes, engine, self.chain.read().unwrap().deref());
if let Err(e) = verify_family_result {
Expand Down

0 comments on commit b70dff4

Please sign in to comment.