Skip to content

Commit

Permalink
fix for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Nov 3, 2022
1 parent ad36548 commit 12404d0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions specs/capella/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,10 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None:
def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
epoch = get_current_epoch(state)
withdrawal_index = state.next_withdrawal_index
index = ValidatorIndex((state.last_withdrawal_validator_index + 1) % len(state.validators))
index = state.last_withdrawal_validator_index
ret: List[Withdrawal] = []
for probed in range(len(state.validators)):
for i in range(len(state.validators)):
index = ValidatorIndex((index + 1) % len(state.validators))
val = state.validators[index]
balance = state.balances[index]
if is_fully_withdrawable_validator(val, balance, epoch):
Expand All @@ -311,8 +312,6 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
withdrawal_index = WithdrawalIndex(withdrawal_index + 1)
if len(ret) == MAX_WITHDRAWALS_PER_PAYLOAD:
break
probed += 1
index = ValidatorIndex((index + probed) % len(state.validators))
return ret
```
Expand Down

0 comments on commit 12404d0

Please sign in to comment.