diff options
| author | tv <tv@krebsco.de> | 2026-11-17 03:30:43 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-17 04:40:18 +0100 |
| commit | 948ee2a80abc2b242ff1a7187522a29e52927a8d (patch) | |
| tree | dbb2d4c39a886cfc0fc2e0b69ff1ce35983167d7 /src/state/host.rs | |
| parent | dc9fa81beea249dc808893fabda569cc33e0f998 (diff) | |
remake: a holding swarm's electorate is the fold's members
The entry of a node that isn't a member counts for nothing where continuum
reads entries (`docs/store.md`, Members): a remake proposed in a swarm
holding a store counts, of the members alive recently enough, those the
fold names with the party their entries name.
Diffstat (limited to 'src/state/host.rs')
| -rw-r--r-- | src/state/host.rs | 14 |
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( |
