aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-06 05:06:40 +0100
committertv <tv@krebsco.de>2026-11-06 05:06:40 +0100
commitaf386cfa95cf7ab345803b7222cc88617c6cd4b5 (patch)
tree7cbde2dfbf641da70d14f0bd9780ce42c28b5cac /src/swarm
parent31378bcb137f3d43bb74604df0a9e601b07d1525 (diff)
heads heard in announcements
Diffstat (limited to 'src/swarm')
-rw-r--r--src/swarm/peer/inbound.rs4
-rw-r--r--src/swarm/peer/keepalive.rs4
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;