diff options
Diffstat (limited to 'src/state/peer.rs')
| -rw-r--r-- | src/state/peer.rs | 10 |
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 |
