summaryrefslogtreecommitdiffstats
path: root/src/swarm/sync.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-26 19:21:13 +0100
committertv <tv@krebsco.de>2026-10-26 19:21:13 +0100
commit9a165fd06a1b52bb943a84f26adf8dec72056143 (patch)
treede83e9ab1a64e99b370e7102aceccb49b5def43c /src/swarm/sync.rs
parentf819296674debea160f19a61d09ac1eea4462820 (diff)
add pull queue
Diffstat (limited to 'src/swarm/sync.rs')
-rw-r--r--src/swarm/sync.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs
index 868fead..0fbff05 100644
--- a/src/swarm/sync.rs
+++ b/src/swarm/sync.rs
@@ -400,7 +400,8 @@ pub(crate) async fn handle_sync(
source::reported(state, peer, from_ready, None);
- if caught_up && !state.initial_sync_done.swap(true, Ordering::AcqRel) {
+ let just_caught_up = caught_up && !state.initial_sync_done.swap(true, Ordering::AcqRel);
+ if just_caught_up {
info!(peer = %peer, "Initial sync complete");
state
.stats
@@ -411,7 +412,8 @@ pub(crate) async fn handle_sync(
state.notify_store_changed();
crate::swarm::relay::pulled(state, peer);
- if changed {
+ // Caught up: our other neighbours may lack what the source had.
+ if changed || just_caught_up {
crate::swarm::relay::announce(state, peer).await;
}