From 40073ebf9570464a69a928eba9c51b4dad6e699a Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Nov 2026 05:14:12 +0100 Subject: announcements answered when lacking A neighbour now answers an announcement only if it lacks some of the announced heads. Heads that merely differ are no longer enough, since they do while writes go on. The check reads the document, so it runs off the message consumer, as the pull check already does. --- src/swarm/reach.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/swarm/reach.rs') diff --git a/src/swarm/reach.rs b/src/swarm/reach.rs index 7bd0f73..5c89d04 100644 --- a/src/swarm/reach.rs +++ b/src/swarm/reach.rs @@ -72,8 +72,8 @@ pub(crate) fn published(state: &AppState) -> Vec { /// With the peer worker's periodic pass (every 5 s), and at once when a member we said /// we reach stops answering (`reached_stops_answering`): whom we reach now; if it changed, -/// our neighbours are told at once (a STATUS each, unanswered if the heads are the -/// same). A change that is undone within a pass isn't told. +/// our neighbours are told at once (a STATUS each, unanswered unless they lack some of +/// our heads). A change that is undone within a pass isn't told. pub(crate) async fn check(state: &AppState) { let now = measure(state).await; { @@ -109,8 +109,8 @@ pub(crate) fn reached_stops_answering(state: &AppState, peer: &str) -> bool { .is_some_and(|keys| keys.contains(&topology::pair_key(peer))) } -/// A STATUS to `peer` with whom we reach: as an announcement (unanswered if the heads -/// are the same), but with `reaches`. +/// A STATUS to `peer` with whom we reach: as an announcement (unanswered unless it lacks +/// some of our heads), but with `reaches`. async fn tell(state: &AppState, peer: &str) -> anyhow::Result<()> { announce_heads(state, peer, true).await } -- cgit v1.3.1