From 08181512a3bd17da75365a517c2e44ef5b8e5d2a Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Tue, 16 Jan 2024 01:31:01 +0800 Subject: [PATCH] ConsumeOrphan should mark the block as PARTIAL_STORED before send it to consume_unverified thread --- chain/src/consume_orphan.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chain/src/consume_orphan.rs b/chain/src/consume_orphan.rs index 6804371db2..9e21474379 100644 --- a/chain/src/consume_orphan.rs +++ b/chain/src/consume_orphan.rs @@ -71,9 +71,6 @@ impl ConsumeDescendantProcessor { self.shared.get_unverified_tip().hash(), ); } - - self.shared - .insert_block_status(block_hash, BlockStatus::BLOCK_PARTIAL_STORED); } fn accept_descendant(&self, block: Arc) -> Result<(HeaderView, U256), Error> { @@ -151,6 +148,11 @@ impl ConsumeDescendantProcessor { pub(crate) fn process_descendant(&self, lonely_block: LonelyBlockWithCallback) { match self.accept_descendant(lonely_block.block().to_owned()) { Ok((parent_header, total_difficulty)) => { + self.shared.insert_block_status( + lonely_block.block().hash(), + BlockStatus::BLOCK_PARTIAL_STORED, + ); + let unverified_block: UnverifiedBlock = lonely_block.combine_parent_header(parent_header);