From 41e290716c9ce517597d4b2dec29c8882c36afdb Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Nov 2026 00:09:59 +0000 Subject: federation: a rule voting `false` on a checkpoint proposed beside one a node backs `--store-nay-beside`, for a node voting by itself: where its party backs a proposal on the current version that can still pass, by its record or by what it votes now, it votes `false` on every other proposal there that only moves to a checkpoint and can still pass, once. So, of two checkpoints proposed at once, the one it doesn't back dies, and its backers are free (`docs/federation.md`, Votes a node casts by itself). --- src/federation/client.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/federation/client.rs') diff --git a/src/federation/client.rs b/src/federation/client.rs index ef6e116..85411fe 100644 --- a/src/federation/client.rs +++ b/src/federation/client.rs @@ -242,6 +242,15 @@ impl Record { .map_err(|error| format!("{}: {error}", path.display())) } + /// The proposals on `on` its party voted `true` on, by their hashes. + pub(crate) fn backs(&self, on: &Id) -> Vec { + self.votes_on(on) + .into_iter() + .filter(|vote| vote.yes) + .map(|vote| vote.proposal) + .collect() + } + /// Its votes on `on`, as it cast them. fn votes_on(&self, on: &Id) -> Vec { self.votes -- cgit v1.3.1