Skip to content

Commit

Permalink
chore(tree): log error on unreachable (#4185)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored Aug 14, 2023
1 parent 957f9f4 commit 2aefbd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,12 @@ impl<DB: Database, C: Consensus, EF: ExecutorFactory> BlockchainTree<DB, C, EF>
let canon_fork: BlockNumHash = new_canon_chain.fork_block();
// sanity check
if self.block_indices.canonical_hash(&canon_fork.number) != Some(canon_fork.hash) {
error!(
target: "blockchain_tree",
?canon_fork,
?self.block_indices,
"All chains should point to canonical chain"
);
unreachable!("all chains should point to canonical chain.");
}

Expand Down

0 comments on commit 2aefbd3

Please sign in to comment.