aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/peer.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 03:25:00 +0100
committertv <tv@krebsco.de>2026-11-03 03:25:00 +0100
commit2b4359f23d20b14bae1896512f678d02b7f3c34c (patch)
treeb2bad51e96393463c5f1ac428f3a43d2028c2044 /src/state/peer.rs
parent8f0b588831ac06913dd01a3ebd8bb523292d992e (diff)
introduce eager links
Diffstat (limited to 'src/state/peer.rs')
-rw-r--r--src/state/peer.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/state/peer.rs b/src/state/peer.rs
index c9fa675..c6558d7 100644
--- a/src/state/peer.rs
+++ b/src/state/peer.rs
@@ -146,6 +146,11 @@ pub(crate) struct PeerState {
/// with its epoch: once they are ours, it has every change we would announce to it
/// (`swarm::relay`).
pub(crate) last_heads: Option<(transport::Epoch, transport::HeadsSummary)>,
+ /// The link's modes (`swarm::relay`): whether the peer wants our changes as we apply
+ /// them (its STATUS says so: we forward them to it), and whether we want its (ours
+ /// says so). Both lazy (announced only) until a pull makes ours eager.
+ pub(crate) eager_to: bool,
+ pub(crate) eager_from: bool,
/// It said farewell (`say_farewell`): what else that run of it still sends while it
/// stops doesn't make it active again; a message from another run does (`returned`).
@@ -237,6 +242,8 @@ impl PeerState {
syncs_with_us: None,
reported_heads: None,
last_heads: None,
+ eager_to: false,
+ eager_from: false,
left: false,
hello_attempts: 0,
unreachable_since: None,
@@ -252,6 +259,9 @@ impl PeerState {
let mut reply_backoff = self.sync.reply_backoff;
reply_backoff.reset();
self.sync = SyncSession::new(reply_backoff);
+ // The link starts lazy again: a pull makes it eager when it proves itself.
+ self.eager_to = false;
+ self.eager_from = false;
}
/// An overdue sync answer from an established, active peer (see