aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/relay.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-05 01:23:40 +0100
committertv <tv@krebsco.de>2026-11-05 01:23:40 +0100
commit889e23ee1eb8a209efe7c1eae86aa39091560149 (patch)
tree8da04d6d62f9a1647f90b6ea459eba62b91f5a12 /src/swarm/relay.rs
parent0d16147e95211b0829fddaefb0d014fe0c48dbc8 (diff)
covered neighbours have it
Diffstat (limited to 'src/swarm/relay.rs')
-rw-r--r--src/swarm/relay.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/swarm/relay.rs b/src/swarm/relay.rs
index 58196d3..e049846 100644
--- a/src/swarm/relay.rs
+++ b/src/swarm/relay.rs
@@ -140,18 +140,24 @@ pub(crate) struct Pending {
}
/// After changes from `from` were applied and our heads changed: passed on at once along
-/// the trees of their `writers` (by their authors' pair keys); then announced, in the
+/// the trees of their `writers` (by their authors' pair keys, with their changes);
+/// then announced, in the
/// next round to those the trees leave out, and to the others in the slow round. To all
/// in the next round if any change has no tree to go along: none known whose
/// (`unauthored`), a writer not in the member list, or we have no part in its tree.
-pub(crate) async fn announce(state: &AppState, from: &str, writers: &[u64], unauthored: bool) {
+pub(crate) async fn announce(
+ state: &AppState,
+ from: &str,
+ writers: &[(u64, Vec<crate::document::ChangeHash>)],
+ unauthored: bool,
+) {
if !state.initial_sync_done.load(Ordering::Acquire) {
return;
}
let mut plans = Vec::new();
let mut treeless = unauthored || writers.is_empty();
- for writer in writers {
- match crate::swarm::tree::forward(state, *writer, from).await {
+ for (writer, changes) in writers {
+ match crate::swarm::tree::forward(state, *writer, from, changes).await {
Some(plan) => plans.push(plan),
None => treeless = true,
}