From 371e52cb48bae99232547f6fae6a0487a85c2d04 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 16:18:58 +0200 Subject: add chunked download and use it during rejoin --- src/swarm/sync.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/swarm/sync.rs') diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index 3284015..58a08db 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -32,6 +32,12 @@ pub(crate) struct ChangeSet { } async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> { + if state.remake.fetching_snapshot() { + // Rejoining: the snapshot comes as a download, not in a sync message. Sync + // starts once it is here (`remake::catchup`). + trace!("Waiting for the snapshot download; not syncing yet"); + return Ok(()); + } let Some(peer_state_mutex) = state.get_peer_state(peer).await else { trace!("Peer was forgotten; skipping synchronization"); return Ok(()); -- cgit v1.3.1