Skip to content

Commit

Permalink
Hack moooore
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn committed Dec 7, 2023
1 parent b65ff54 commit 02702e9
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions polkadot/node/overseer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,32 +821,7 @@ where
Ok(())
}

async fn block_finalized(&mut self, block: BlockInfo) -> SubsystemResult<()> {
let mut update = ActiveLeavesUpdate::default();

self.active_leaves.retain(|h, n| {
// prune all orphaned leaves, but don't prune
// the finalized block if it is itself a leaf.
if *n <= block.number && *h != block.hash {
update.deactivated.push(*h);
false
} else {
true
}
});

for deactivated in &update.deactivated {
self.on_head_deactivated(deactivated)
}

// If there are no leaves being deactivated, we don't need to send an update.
//
// Our peers will be informed about our finalized block the next time we
// activating/deactivating some leaf.
if !update.is_empty() {
self.broadcast_signal(OverseerSignal::ActiveLeaves(update)).await?;
}

async fn block_finalized(&mut self, _block: BlockInfo) -> SubsystemResult<()> {
Ok(())
}

Expand Down

0 comments on commit 02702e9

Please sign in to comment.