diff options
Diffstat (limited to 'src/swarm')
| -rw-r--r-- | src/swarm/peer/inbound.rs | 4 | ||||
| -rw-r--r-- | src/swarm/peer/keepalive.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/swarm/peer/inbound.rs b/src/swarm/peer/inbound.rs index 8980fd3..9b701b5 100644 --- a/src/swarm/peer/inbound.rs +++ b/src/swarm/peer/inbound.rs @@ -200,8 +200,10 @@ pub(crate) async fn handle_message( // no reason, as changes on their way to us make them differ while writes go on. if !remote.announcing { status_received(state, &peer).await; - heard_heads(state, &peer, &remote); } + // Announcements too: a neighbour heard from keeps none of its keepalives, so + // while writes go on its announcements are all it says of its heads. + heard_heads(state, &peer, &remote); let local = on_status(state, &peer, &remote, reactivated).await; if remote.announcing { if local.heads != remote.heads { diff --git a/src/swarm/peer/keepalive.rs b/src/swarm/peer/keepalive.rs index a4def86..b4daf53 100644 --- a/src/swarm/peer/keepalive.rs +++ b/src/swarm/peer/keepalive.rs @@ -218,8 +218,8 @@ pub(super) async fn status_received(state: &AppState, peer: &str) { } } -/// A keepalive STATUS, or a STATUS_REPLY, said the peer's heads: what it has counts as sent to it no more -/// (`SyncSession::heard_heads`). Off the consumer: it takes the document's lock. +/// A STATUS, or a STATUS_REPLY, said the peer's heads: what it has counts as sent to it +/// no more (`SyncSession::heard_heads`). Off the consumer: it takes the document's lock. pub(super) fn heard_heads(state: &AppState, peer: &str, remote: &transport::Status) { let Some(heads) = remote.heads.heads() else { return; |
