Skip to content

Commit

Permalink
Early return init_load_unverified thread when no unverified blocks fo…
Browse files Browse the repository at this point in the history
…und after tip
  • Loading branch information
eval-exec committed Aug 27, 2024
1 parent 7304ea7 commit 47f92ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions chain/src/init_load_unverified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ impl InitLoadUnverified {
let unverified_hashes: Vec<packed::Byte32> =
self.find_unverified_block_hashes(check_unverified_number);

if check_unverified_number > tip_number && unverified_hashes.is_empty() {
info!(
"no unverified blocks found after tip, current tip: {}-{}",
tip_number,
self.shared.snapshot().tip_hash()
);
return;
}

for unverified_hash in unverified_hashes {
f(&unverified_hash);
}
Expand Down

0 comments on commit 47f92ff

Please sign in to comment.