diff options
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; } |
