Fix endless loop on mocktally

This commit is contained in:
danielsanchezq 2023-03-15 10:02:29 +01:00
parent 818d7f29cd
commit 780276497f
1 changed files with 4 additions and 5 deletions

View File

@ -66,11 +66,10 @@ impl Tally for MockTally {
return Err(Error("Invalid vote".into()));
}
count_votes += 1;
if count_votes > self.threshold {
return Ok(MockQc { count_votes });
}
}
if count_votes > self.threshold {
Ok(MockQc { count_votes })
} else {
Err(Error("Not enough votes".into()))
}
Err(Error("Not enough votes".into()))
}
}