mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 20:02:43 +00:00
Use CoW
This commit is contained in:
@@ -17,16 +17,13 @@ pub fn slash_validator<T: EthSpec>(
|
||||
|
||||
initiate_validator_exit(state, slashed_index, spec)?;
|
||||
|
||||
let mut validators = state.validators_mut();
|
||||
let validator = validators.get_validator_mut(slashed_index)?;
|
||||
let validator = state.get_validator_mut(slashed_index)?;
|
||||
validator.slashed = true;
|
||||
validator.withdrawable_epoch = cmp::max(
|
||||
validator.withdrawable_epoch,
|
||||
epoch.safe_add(T::EpochsPerSlashingsVector::to_u64())?,
|
||||
);
|
||||
let validator_effective_balance = validator.effective_balance;
|
||||
drop(validators);
|
||||
|
||||
state.set_slashings(
|
||||
epoch,
|
||||
state
|
||||
|
||||
Reference in New Issue
Block a user