aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/reach.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-04 05:14:12 +0100
committertv <tv@krebsco.de>2026-11-04 05:14:12 +0100
commit40073ebf9570464a69a928eba9c51b4dad6e699a (patch)
treef82fdd38ed24603be5c66740af39a786f213cd1a /src/swarm/reach.rs
parente8d1cbddcaec18f79f54cad671f15bbaa189673b (diff)
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.
Diffstat (limited to 'src/swarm/reach.rs')
-rw-r--r--src/swarm/reach.rs8
1 files changed, 4 insertions, 4 deletions
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<u64> {
/// 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
}