diff options
| author | tv <tv@krebsco.de> | 2026-10-23 21:25:34 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-23 21:44:13 +0200 |
| commit | 2311d0cc57a2e0d5776b355983ca2e3f82f9980f (patch) | |
| tree | 391c8aa2988b8216995eb0d5ed6279701e435b12 /src/transport/mod.rs | |
| parent | f9731343f71beced8ec8c817d19022fdfebc4545 (diff) | |
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.
Diffstat (limited to 'src/transport/mod.rs')
| -rw-r--r-- | src/transport/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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). |
