fix unhappy path

This commit is contained in:
Giacomo Pasini 2023-05-15 14:47:41 +02:00
parent 3c569e1278
commit a94f9300fd
No known key found for this signature in database
GPG Key ID: FC08489D2D895D4B
1 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,12 @@ impl Tally for NewViewTally {
) -> Result<(Self::Qc, Self::Outcome), Self::TallyError> {
let mut seen = HashSet::new();
let mut outcome = HashSet::new();
// return early for leaf nodes
if self.settings.threshold == 0 {
return Ok(((), outcome));
}
while let Some(vote) = vote_stream.next().await {
// check vote view is valid
if !vote.vote.view != timeout_qc.view {