Litany of bug fixes

Also attempts to make the code more readable while updating/correcting 
documentation.
This commit is contained in:
Luke Parker
2022-10-17 10:37:30 -04:00
parent 5724f52816
commit 8b6eb1172f
2 changed files with 118 additions and 102 deletions

View File

@@ -85,6 +85,17 @@ impl<N: Network> MessageLog<N> {
weight
}
// Check if a supermajority of nodes have participated on a specific step
pub(crate) fn has_participation(&self, round: Round, step: Step) -> bool {
let mut participating = 0;
for (participant, msgs) in &self.log[&round] {
if msgs.get(&step).is_some() {
participating += self.weights.weight(*participant);
}
}
participating >= self.weights.threshold()
}
// Check if consensus has been reached on a specific piece of data
pub(crate) fn has_consensus(
&self,