Skip to content

Commit

Permalink
fix(partial-withdrawal): update nextValIndex when skipping sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
ezreal1997 committed Aug 22, 2024
1 parent c8a5aa8 commit aca254e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/x/evmstaking/keeper/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func (k Keeper) ExpectedPartialWithdrawals(ctx context.Context) ([]estypes.Withd
break
}
if validatorSet[nextValIndex].IsJailed() {
continue
// NOTE: always remember to update the `nextValIndex` when you skip for some reasons.
nextValIndex = (nextValIndex + 1) % int64(len(validatorSet))
}
// Get validator's address.
valBz, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(validatorSet[nextValIndex].GetOperator())
Expand Down

0 comments on commit aca254e

Please sign in to comment.