fix topCandidates in function GetCandidates

This commit is contained in:
Daniel Liu 2023-07-14 14:47:38 +08:00
parent 3214bbeeba
commit 7dc5ffe45a

View file

@ -954,8 +954,8 @@ func (s *PublicBlockChainAPI) GetCandidates(ctx context.Context, epoch rpc.Epoch
penaltyList = common.ExtractAddressFromBytes(penalties)
var topCandidates []utils.Masternode
if len(candidates) > common.MaxMasternodes {
topCandidates = candidates[:common.MaxMasternodes]
if len(candidates) > maxMasternodes {
topCandidates = candidates[:maxMasternodes]
} else {
topCandidates = candidates
}