aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/host.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/host.rs')
-rw-r--r--src/state/host.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/state/host.rs b/src/state/host.rs
index 4da5836..345dfbf 100644
--- a/src/state/host.rs
+++ b/src/state/host.rs
@@ -323,7 +323,19 @@ impl Host for AppState {
}
fn electorate(&self, doc: &impl ReadDoc, now: crate::clock::UnixMillis) -> Vec<String> {
- crate::swarm::members::electorate(doc, now.as_u64(), self.electorate_window)
+ let electorate =
+ crate::swarm::members::electorate(doc, now.as_u64(), self.electorate_window);
+ // Holding a store: the members the fold names, with the party their entries name;
+ // another's entry counts for nothing (`docs/store.md`, Members).
+ #[cfg(feature = "federation")]
+ let electorate = electorate
+ .into_iter()
+ .filter(|node| {
+ let party = crate::swarm::members::party(doc, node);
+ self.holding.member(node, party.as_deref()) != Some(false)
+ })
+ .collect();
+ electorate
}
fn fetch_change(