aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/client.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-17 00:09:59 +0000
committertv <tv@krebsco.de>2026-11-17 01:45:53 +0100
commit41e290716c9ce517597d4b2dec29c8882c36afdb (patch)
tree41ac19e6f9c9ba23448576c906e7a56b32a07517 /src/federation/client.rs
parentcd47b1fc79893507096d4b6b7e25f47ee8c7cdbb (diff)
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).
Diffstat (limited to 'src/federation/client.rs')
-rw-r--r--src/federation/client.rs9
1 files changed, 9 insertions, 0 deletions
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<Id> {
+ 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<Vote> {
self.votes