diff options
Diffstat (limited to 'src/remake/coordinator.rs')
| -rw-r--r-- | src/remake/coordinator.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/remake/coordinator.rs b/src/remake/coordinator.rs index 370d5fc..96edb91 100644 --- a/src/remake/coordinator.rs +++ b/src/remake/coordinator.rs @@ -13,7 +13,7 @@ //! every node can verify its own build against it. //! //! The task lives only in memory. If the coordinator dies, nobody decides and the -//! proposal expires (its votes become void). +//! proposal expires; its votes stay cast (`vote`). use std::time::Duration; @@ -47,8 +47,14 @@ pub(crate) async fn run<H: Host>(host: H, id: String) { /// One evaluation. Returns true once the coordinator is done. async fn step<H: Host>(host: &H, id: &str) -> Result<bool, StoreError> { let wanted = id.to_owned(); - let (record, all) = host - .read_doc(move |doc| (records::load(doc, &wanted), records::load_all(doc))) + let (record, all, register) = host + .read_doc(move |doc| { + ( + records::load(doc, &wanted), + records::load_all(doc), + records::load_register(doc), + ) + }) .await; let Some(record) = record else { @@ -67,7 +73,7 @@ async fn step<H: Host>(host: &H, id: &str) -> Result<bool, StoreError> { return Ok(true); } - let tally = vote::tally(id, &record, &all, now, grace); + let tally = vote::tally(id, &record, &all, ®ister); if tally.reached() { info!(remake = %id, votes = %tally, "Majority reached"); commit(host, id, &record).await?; |
