Skip to content

Commit

Permalink
refactor patch-validators-trim-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Mar 27, 2024
1 parent a321866 commit 53534c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x/staking/keeper/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func (k Keeper) GetLastValidators(ctx context.Context) (validators []types.Valid
for ; iterator.Valid(); iterator.Next() {
// sanity check
if i >= int(maxValidators) {
panic("more validators than maxValidators found")
return validators[:i], nil // trim
}

address := types.AddressFromLastValidatorPowerKey(iterator.Key())
Expand Down

0 comments on commit 53534c4

Please sign in to comment.