Skip to content

Commit

Permalink
Add more comments to track_newly_created_chains.
Browse files Browse the repository at this point in the history
  • Loading branch information
afck committed Oct 29, 2024
1 parent dcc5e6b commit 9aebea0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions linera-core/src/chain_worker/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,19 @@ where
self.recent_blobs.insert(blob).await
}

/// Adds any newly created chains to the set of `tracked_chains`.
/// Adds any newly created chains to the set of `tracked_chains`, if the parent chain is
/// also tracked.
///
/// Chains that are not tracked are usually processed only because they sent some message
/// to one of the tracked chains. In most use cases, their children won't be of interest.
fn track_newly_created_chains(&self, executed_block: &ExecutedBlock) {
if let Some(tracked_chains) = self.tracked_chains.as_ref() {
if !tracked_chains
.read()
.expect("Panics should not happen while holding a lock to `tracked_chains`")
.contains(&executed_block.block.chain_id)
{
return;
return; // The parent chain is not tracked; don't track the child.
}
let messages = executed_block.messages().iter().flatten();
let open_chain_message_indices =
Expand Down

0 comments on commit 9aebea0

Please sign in to comment.