From a73d3c9ce75dec43786fe740fb8e4155d3e4f1f6 Mon Sep 17 00:00:00 2001 From: edwardmack Date: Fri, 8 Jul 2022 10:40:16 -0400 Subject: [PATCH] simplify condition check --- lib/grandpa/message_handler.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/grandpa/message_handler.go b/lib/grandpa/message_handler.go index 7c829d85ac..1afd5dbf7d 100644 --- a/lib/grandpa/message_handler.go +++ b/lib/grandpa/message_handler.go @@ -290,10 +290,8 @@ func getEquivocatoryVoters(votes []AuthData) map[ed25519.PublicKeyBytes]struct{} for _, v := range votes { signature, present := voters[v.AuthorityID] - if present { - if !bytes.Equal(signature[:], v.Signature[:]) { - eqvVoters[v.AuthorityID] = struct{}{} - } + if present && !bytes.Equal(signature[:], v.Signature[:]) { + eqvVoters[v.AuthorityID] = struct{}{} } else { voters[v.AuthorityID] = v.Signature }