summaryrefslogtreecommitdiffstats
path: root/src/swarm/sync.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 16:18:58 +0200
committertv <tv@krebsco.de>2026-10-24 16:18:58 +0200
commit396927c20677fc458334d7dcbee1c4330f91652c (patch)
tree439ccfdd31da3a17c33af55d0a302bacc9036f71 /src/swarm/sync.rs
parentec15182174e5f6f6e3990d3b0ae0d6149e64fef0 (diff)
add chunked download and use it during rejoin
Diffstat (limited to 'src/swarm/sync.rs')
-rw-r--r--src/swarm/sync.rs6
1 files changed, 6 insertions, 0 deletions
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(());