Skip to content

Commit

Permalink
ConsumeOrphan should mark the block as PARTIAL_STORED before send it …
Browse files Browse the repository at this point in the history
…to consume_unverified thread
  • Loading branch information
eval-exec committed Jan 16, 2024
1 parent 501805f commit d39df91
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chain/src/consume_orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlockView>) -> Result<(HeaderView, U256), Error> {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit d39df91

Please sign in to comment.