aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/party.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/federation/party.rs')
-rw-r--r--src/federation/party.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/federation/party.rs b/src/federation/party.rs
index d7880c2..ecd75a9 100644
--- a/src/federation/party.rs
+++ b/src/federation/party.rs
@@ -364,7 +364,8 @@ async fn vote(
.filter_map(|id| id.as_str().and_then(Id::from_hex))
.collect()
};
- let Some(proposing) = ids(&proposal, "proposals").first().copied() else {
+ let proposals = ids(&proposal, "proposals");
+ let Some(proposing) = proposals.first().copied() else {
bail!("no proposal of hash {proposal} on the current version, as the node reads it");
};
let proposed = match Event::read(&node.event(&proposing).await?) {
@@ -400,8 +401,9 @@ async fn vote(
let kept = record
.may_vote(&current, proposal, &proposed, yes, &nays)
.map_err(|why| anyhow!(why))?;
- let (_, heads) = node.summary().await?;
- let cast = signer.sign(&heads, event::vote(current.hash, proposal, yes));
+ // On the events proposing it: above the heads it names for a checkpoint wherever they
+ // are, so a version event may be written on it.
+ let cast = signer.sign(&proposals, event::vote(current.hash, proposal, yes));
record.cast(&current, &cast, kept);
record.save(path).map_err(|why| anyhow!(why))?;
node.put(&cast).await