Skip to content

Commit

Permalink
Merge pull request #637 from ethereum/hwwhww-patch-2
Browse files Browse the repository at this point in the history
Fix `slash_validator`
  • Loading branch information
djrtwo authored Feb 15, 2019
2 parents e074bc2 + 6f856ba commit f932534
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -1372,9 +1372,9 @@ def slash_validator(state: BeaconState, index: ValidatorIndex) -> None:
Slash the validator with index ``index``.
Note that this function mutates ``state``.
"""
assert state.slot < validator.withdrawable_epoch # [TO BE REMOVED IN PHASE 2]
exit_validator(state, index)
validator = state.validator_registry[index]
assert state.slot < get_epoch_start_slot(validator.withdrawable_epoch) # [TO BE REMOVED IN PHASE 2]
exit_validator(state, index)
state.latest_slashed_balances[get_current_epoch(state) % LATEST_SLASHED_EXIT_LENGTH] += get_effective_balance(state, index)

whistleblower_index = get_beacon_proposer_index(state, state.slot)
Expand Down

0 comments on commit f932534

Please sign in to comment.