From 47f92ffac680759199e0da78261be788e8bb59d8 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Tue, 27 Aug 2024 12:13:15 +0800 Subject: [PATCH] Early return init_load_unverified thread when no unverified blocks found after tip --- chain/src/init_load_unverified.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chain/src/init_load_unverified.rs b/chain/src/init_load_unverified.rs index e2c4ebae00..30b0247cdb 100644 --- a/chain/src/init_load_unverified.rs +++ b/chain/src/init_load_unverified.rs @@ -93,6 +93,15 @@ impl InitLoadUnverified { let unverified_hashes: Vec = 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); }