diff options
| author | tv <tv@krebsco.de> | 2026-11-06 04:33:25 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-06 04:33:25 +0100 |
| commit | 26ff4ff86b58fed130ce6802ac4aceba8ee93443 (patch) | |
| tree | 211d02471381b6a32a2362d1ecc43a51992ef6ae /src/swarm/tree.rs | |
| parent | 645ea5c150df5fd55493d91fd5d8ada614bd1252 (diff) | |
plan walks the neighbours
Diffstat (limited to 'src/swarm/tree.rs')
| -rw-r--r-- | src/swarm/tree.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/swarm/tree.rs b/src/swarm/tree.rs index 3ed8a9b..9c9651e 100644 --- a/src/swarm/tree.rs +++ b/src/swarm/tree.rs @@ -586,10 +586,11 @@ pub(crate) async fn plan(state: &AppState, writer: u64) -> Option<Plan> { } } // Neighbours the member list's graph doesn't give us (not listed yet, or only - // connecting out): no tree has them. - for (peer, _) in state.peers_snapshot().await { - if topology::is_neighbour(state, &peer) - && !graph.get(me).is_some_and(|ours| ours.contains(&peer)) + // connecting out): no tree has them. From the neighbours, not every peer known: this + // runs for every change passed on. + for peer in topology::our_neighbours(state) { + if !graph.get(me).is_some_and(|ours| ours.contains(&peer)) + && state.get_peer_state(&peer).await.is_some() { uncovered.push(peer); } |
