Skip to content

Commit

Permalink
Check if BEEFY authority is in current set (paritytech#10281)
Browse files Browse the repository at this point in the history
* check if BEEFY authority is in current set

* Update client/beefy/src/round.rs

Co-authored-by: Bastian Köcher <[email protected]>

* Update client/beefy/src/round.rs

* Update client/beefy/src/round.rs

Co-authored-by: Andreas Doerr <[email protected]>

* remove stray semi

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Andreas Doerr <[email protected]>
  • Loading branch information
3 people authored and ark0f committed Feb 27, 2023
1 parent 2a2b943 commit e58b6d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/beefy/src/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ where
}

pub(crate) fn add_vote(&mut self, round: (H, N), vote: (Public, Signature)) -> bool {
self.rounds.entry(round).or_default().add_vote(vote)
if self.validator_set.validators.iter().any(|id| vote.0 == *id) {
self.rounds.entry(round).or_default().add_vote(vote)
} else {
false
}
}

pub(crate) fn is_done(&self, round: &(H, N)) -> bool {
Expand Down

0 comments on commit e58b6d4

Please sign in to comment.