Skip to content

Commit

Permalink
Take subscriptions into account in all_messages_to_tracked_chains_del…
Browse files Browse the repository at this point in the history
…ivered_up_to.
  • Loading branch information
afck committed Nov 4, 2024
1 parent e3db8d0 commit 6bef71d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion linera-core/src/chain_worker/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,20 @@ where
};
let mut targets = self.chain.outboxes.indices().await?;
{
let publishers = self
.chain
.execution_state
.system
.subscriptions
.indices()
.await?
.iter()
.map(|subscription| subscription.chain_id)
.collect::<HashSet<_>>();
let tracked_chains = tracked_chains.read().unwrap();
targets.retain(|target| tracked_chains.contains(&target.recipient));
targets.retain(|target| {
tracked_chains.contains(&target.recipient) || publishers.contains(&target.recipient)
});
}
let outboxes = self.chain.outboxes.try_load_entries(&targets).await?;
for outbox in outboxes {
Expand Down

0 comments on commit 6bef71d

Please sign in to comment.