diff options
Diffstat (limited to 'src/state/host.rs')
| -rw-r--r-- | src/state/host.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/state/host.rs b/src/state/host.rs index 0b2b27d..34ed7ed 100644 --- a/src/state/host.rs +++ b/src/state/host.rs @@ -30,7 +30,7 @@ impl AppState { replica.signatures = replica.signatures.kept_for(&replica.doc); if let Some(key) = &self.node_key { let replica = &mut *replica; - let own = self.remake.own_actors(); + let own = self.own_writers.all(); replica .signatures .sign_own_actors(&mut replica.doc, key, &own); @@ -110,7 +110,7 @@ impl AppState { /// of the document (past `SMALL_DROP`), wait for another's. const BIG_DROP: usize = 100; const SMALL_DROP: usize = 10; - let own = self.remake.own_actors(); + let own = self.own_writers.all(); // Another member to hear it from: a node with one neighbour, the one telling, has // only its word (a swarm of two, a leaf), and waiting would hold the drop for good. let another = crate::swarm::topology::our_neighbours(self) @@ -221,7 +221,7 @@ impl AppState { }, }) .collect(); - state.remake.add_own_actor(actor); + state.own_writers.add(actor); let epoch = replica.epoch; let old = state.swap_document(&mut replica, epoch, fresh); { @@ -297,6 +297,10 @@ impl Host for AppState { &self.remake } + fn own_writers(&self) -> &crate::document::own::OwnWriters { + &self.own_writers + } + fn clock(&self) -> Arc<crate::clock::Clock> { Arc::clone(&self.clock) } @@ -533,7 +537,7 @@ impl Host for AppState { // What it replayed, vouched for at once. if let Some(key) = &state.node_key { let replica = &mut *replica; - let own = state.remake.own_actors(); + let own = state.own_writers.all(); replica .signatures .sign_own_actors(&mut replica.doc, key, &own); @@ -617,7 +621,7 @@ impl Host for AppState { ) .map(|outcome| { if let Some(actor) = outcome.fresh_actor { - state.remake.add_own_actor(actor); + state.own_writers.add(actor); } }) .map_err(|error| format!("{error:#}")) |
