From c914173379941d7df67ccff0c16a2d6a46c4291d Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 20:09:15 +0200 Subject: follow and download from ready members only --- src/state.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index c51446f..9383c89 100644 --- a/src/state.rs +++ b/src/state.rs @@ -643,13 +643,14 @@ impl AppState { self.transport.local_id() } - /// Peers that are active and last said they are on our epoch. + /// Peers that can serve our epoch's data: active, ready members on our epoch + /// (`PeerSummary::serves_epoch`). pub(crate) async fn active_peers_on_local_epoch(&self) -> Vec { let epoch = self.local_epoch(); self.peer_summaries() .await .into_iter() - .filter(|peer| peer.active && peer.epoch == Some(epoch)) + .filter(|peer| peer.serves_epoch(epoch)) .map(|peer| peer.id) .collect() } @@ -1090,6 +1091,9 @@ impl Host for AppState { summaries.push(PeerSummary { id, active: peer.liveness == Liveness::Active, + member: matches!(peer.standing, Standing::Member { .. }) + && peer.hello_state == HelloState::Established, + ready: peer.reports_ready, epoch: peer.epoch, }); } -- cgit v1.3.1