Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hack moooore
  • Loading branch information
s0me0ne-unkn0wn committed Dec 7, 2023
commit 02702e962bd57d97b9524d1a891782432ad47347
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