diff --git a/consensus/quorum/quorum.go b/consensus/quorum/quorum.go index 4ae0e0708..a37d1f1b8 100644 --- a/consensus/quorum/quorum.go +++ b/consensus/quorum/quorum.go @@ -72,7 +72,7 @@ type ParticipantTracker interface { Participants() multibls.PublicKeys IndexOf(bls.SerializedPublicKey) int ParticipantsCount() int64 - NextAfter(*bls.PublicKeyWrapper, int) (bool, *bls.PublicKeyWrapper) + NthNext(*bls.PublicKeyWrapper, int) (bool, *bls.PublicKeyWrapper) UpdateParticipants(pubKeys []bls.PublicKeyWrapper) } @@ -187,8 +187,8 @@ func (s *cIdentities) IndexOf(pubKey bls.SerializedPublicKey) int { return -1 } -// NextAfter return the next pubkey, next can be negative number -func (s *cIdentities) NextAfter(pubKey *bls.PublicKeyWrapper, next int) (bool, *bls.PublicKeyWrapper) { +// NthNext return the Nth next pubkey, next can be negative number +func (s *cIdentities) NthNext(pubKey *bls.PublicKeyWrapper, next int) (bool, *bls.PublicKeyWrapper) { found := false idx := s.IndexOf(pubKey.Bytes) diff --git a/consensus/view_change.go b/consensus/view_change.go index 682e1ea47..2495546e7 100644 --- a/consensus/view_change.go +++ b/consensus/view_change.go @@ -98,7 +98,7 @@ func (consensus *Consensus) GetNextLeaderKey(viewID uint64) *bls.PublicKeyWrappe Uint64("newViewID", viewID). Uint64("myCurBlockViewID", consensus.GetCurBlockViewID()). Msg("[GetNextLeaderKey] got leaderPubKey from coinbase") - wasFound, next := consensus.Decider.NextAfter(consensus.LeaderPubKey, gap) + wasFound, next := consensus.Decider.NthNext(consensus.LeaderPubKey, gap) if !wasFound { consensus.getLogger().Warn(). Str("key", consensus.LeaderPubKey.Bytes.Hex()).