aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/sync.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-06 16:35:02 +0100
committertv <tv@krebsco.de>2026-11-06 16:35:02 +0100
commit8a134df62167a85fa083ccf480a939fd654e2419 (patch)
treed571d3ff39f013c4d0e3a9cb4b377c8f267e9853 /src/swarm/sync.rs
parentb18c75f20f937229c9b12bf3f07901090bd35317 (diff)
dissemination trait
Diffstat (limited to 'src/swarm/sync.rs')
-rw-r--r--src/swarm/sync.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs
index 66fa4a5..45d3d75 100644
--- a/src/swarm/sync.rs
+++ b/src/swarm/sync.rs
@@ -687,7 +687,10 @@ pub(crate) async fn handle_sync(
crate::swarm::relay::pulled(state, peer);
if state.initial_sync_done.load(Ordering::Acquire) && !just_caught_up {
- crate::swarm::tree::note_arrival(state, peer, writer, carried, &authors).await;
+ state
+ .dissemination
+ .note_arrival(state, peer, writer, carried, &authors)
+ .await;
}
// Caught up: our other neighbours may lack what the source had.
if changed || just_caught_up {
@@ -703,7 +706,7 @@ pub(crate) async fn handle_sync(
// A writer's changes along its tree that we had already: they came another way
// first, not saying whose (with an answer to one of our messages, say), so we
// passed nothing on then. Our children in its tree may lack them still.
- crate::swarm::tree::forward(state, writer, peer, &[]).await;
+ state.dissemination.forward(state, writer, peer, &[]).await;
}
state
@@ -941,7 +944,7 @@ pub(crate) async fn run_sync_worker(state: AppState, mut rx: mpsc::UnboundedRece
let own = crate::swarm::topology::pair_key(state.local_id());
let ours = own_changes(&state, &mut seen_heads).await;
let covered = match &ours {
- Some(ours) => match crate::swarm::tree::plan(&state, own).await {
+ Some(ours) => match state.dissemination.plan(&state, own).await {
Some(plan) => {
for neighbour in &plan.covered {
if let Some(peer_state) = state.get_peer_state(neighbour).await {