Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor modification to reduce lines of code #607

Merged
merged 2 commits into from
Feb 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -2030,12 +2030,10 @@ def process_penalties_and_exits(state: BeaconState) -> None:
eligible_indices = filter(eligible, all_indices)
# Sort in order of exit epoch, and validators that exit within the same epoch exit in order of validator index
sorted_indices = sorted(eligible_indices, key=lambda index: state.validator_registry[index].exit_epoch)
withdrawn_so_far = 0
for index in sorted_indices:
prepare_validator_for_withdrawal(state, index)
withdrawn_so_far += 1
for withdrawn_so_far, index in enumerate(sorted_indices):
if withdrawn_so_far >= MAX_WITHDRAWALS_PER_EPOCH:
JustinDrake marked this conversation as resolved.
Show resolved Hide resolved
break
prepare_validator_for_withdrawal(state, index)
```

#### Final updates
Expand Down