From e58b6d491e4fb62cef1fbac4a57f749c7312ff91 Mon Sep 17 00:00:00 2001 From: Seun Lanlege Date: Wed, 17 Nov 2021 13:46:10 +0100 Subject: [PATCH] Check if BEEFY authority is in current set (#10281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * check if BEEFY authority is in current set * Update client/beefy/src/round.rs Co-authored-by: Bastian Köcher * Update client/beefy/src/round.rs * Update client/beefy/src/round.rs Co-authored-by: Andreas Doerr * remove stray semi Co-authored-by: Bastian Köcher Co-authored-by: Andreas Doerr --- client/beefy/src/round.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/beefy/src/round.rs b/client/beefy/src/round.rs index 7d443603b364e..51284c9bd2f6e 100644 --- a/client/beefy/src/round.rs +++ b/client/beefy/src/round.rs @@ -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 {