aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/tree.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/swarm/tree.rs')
-rw-r--r--src/swarm/tree.rs9
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);
}