summaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-23 21:25:34 +0200
committertv <tv@krebsco.de>2026-10-23 21:44:13 +0200
commit2311d0cc57a2e0d5776b355983ca2e3f82f9980f (patch)
tree391c8aa2988b8216995eb0d5ed6279701e435b12 /src/state.rs
parentf9731343f71beced8ec8c817d19022fdfebc4545 (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/state.rs')
-rw-r--r--src/state.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs
index 4fbc05b..23892a9 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -120,6 +120,9 @@ pub(crate) struct PeerState {
/// Epoch the peer advertised in its most recent message.
pub(crate) epoch: Option<Epoch>,
+
+ /// Whether the peer was ready according to its most recent sync message.
+ pub(crate) reports_ready: Option<bool>,
}
/// One Automerge sync with a peer, from a reset to the next. Everything a reset must
@@ -322,6 +325,7 @@ impl PeerState {
last_sync_rx: None,
last_resync_at: None,
epoch: None,
+ reports_ready: None,
}
}