Skip to content

Commit

Permalink
fix(partial-withdrawal): update nextValIndex when skipping sweep (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezreal1997 authored Aug 22, 2024
1 parent c8a5aa8 commit 1b50cbc
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 1b50cbc

Please sign in to comment.