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 | ae5d7419cf0f81dda89547e58e44153c57b60115 (patch) | |
| tree | 5de44e633a54f83365064692085e0ac4871292e8 /src/swarm/sync.rs | |
| parent | de6624c3832244d8e27282bf1e71ba8ec9235fe4 (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; } |
