diff options
| author | tv <tv@krebsco.de> | 2026-10-26 19:21:13 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-26 19:21:13 +0100 |
| commit | 9a165fd06a1b52bb943a84f26adf8dec72056143 (patch) | |
| tree | de83e9ab1a64e99b370e7102aceccb49b5def43c /src/swarm/sync.rs | |
| parent | f819296674debea160f19a61d09ac1eea4462820 (diff) | |
add pull queue
Diffstat (limited to 'src/swarm/sync.rs')
| -rw-r--r-- | src/swarm/sync.rs | 6 |
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; } |
