From 2311d0cc57a2e0d5776b355983ca2e3f82f9980f Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 23 Oct 2026 21:25:34 +0200 Subject: use only ready peers as sync source Sync messages now carries a ready flag, telling whether the sending peer itself is joined or is itself still (re-)joining. In the latter case, the peer won't be used as sync source. --- src/transport/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/transport/mod.rs') diff --git a/src/transport/mod.rs b/src/transport/mod.rs index 69d9e70..eeba47f 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -62,6 +62,10 @@ pub struct SyncEnvelope { /// Epoch of the document the message was generated from. pub epoch: Epoch, pub message: Message, + /// The sender was ready when it generated the message: its document is the swarm's, + /// not one it is still filling (joining, rejoining). Only such a peer can tell a + /// catching-up node that it has everything; an empty document says nothing else. + pub ready: bool, } /// A message serialized for the wire. Cloning is cheap (shared buffer). -- cgit v1.3.1