diff options
| author | tv <tv@krebsco.de> | 2026-10-24 20:09:15 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-24 20:09:15 +0200 |
| commit | 02c90641fbb149392b3d20ab874c3c0e8595f42a (patch) | |
| tree | 517c7d0b60618b179b4b98a5e1da6e1630bd707a /src/state.rs | |
| parent | c8c78b48eabab7d24b90daa26a5d1e4d888bd092 (diff) | |
follow and download from ready members only
Diffstat (limited to 'src/state.rs')
| -rw-r--r-- | src/state.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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<String> { 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, }); } |
