diff options
Diffstat (limited to 'src/swarm/relay.rs')
| -rw-r--r-- | src/swarm/relay.rs | 14 |
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, } |
