summaryrefslogtreecommitdiffstats
path: root/src/remake/catchup.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 20:09:15 +0200
committertv <tv@krebsco.de>2026-10-24 20:09:15 +0200
commitc914173379941d7df67ccff0c16a2d6a46c4291d (patch)
tree3eb8a31be05d1e21fd27c675261865d5d931cc68 /src/remake/catchup.rs
parent377d3b2fa3c2e9f67abe14f2ef9d6f167caa2fa1 (diff)
follow and download from ready members only
Diffstat (limited to 'src/remake/catchup.rs')
-rw-r--r--src/remake/catchup.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/remake/catchup.rs b/src/remake/catchup.rs
index 39b9550..56aeee1 100644
--- a/src/remake/catchup.rs
+++ b/src/remake/catchup.rs
@@ -71,11 +71,13 @@ pub(super) async fn check<H: Host>(host: &H) {
}
let local = host.current_epoch();
+ // Only ready members count: a rejoining peer advertises an epoch it doesn't hold
+ // yet, and a node of another swarm (or a stranger) advertises one that isn't ours.
let mut ahead: Vec<(String, Epoch)> = host
.peer_summaries()
.await
.into_iter()
- .filter(|peer| peer.active)
+ .filter(|peer| peer.serves())
.filter_map(|peer| peer.epoch.map(|epoch| (peer.id, epoch)))
.filter(|(_, epoch)| epoch.generation > local.generation)
.collect();