aboutsummaryrefslogtreecommitdiffstats
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
commit2044eba5744be090d9a8111a91fc2589770f9e7a (patch)
tree21bbf8b43198e9ad92cfb2c5a86a9a306720a9ca /src/swarm/sync.rs
parentd816121dfe51f8ffbc36c93bbd52be21272482cd (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(());