mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Implement "Limit consolidating balance by validator.effective_balance"
This commit is contained in:
@@ -1057,14 +1057,12 @@ fn process_pending_consolidations<E: EthSpec>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the consolidated balance
|
// Calculate the consolidated balance
|
||||||
let max_effective_balance =
|
|
||||||
source_validator.get_max_effective_balance(spec, state_ctxt.fork_name);
|
|
||||||
let source_effective_balance = std::cmp::min(
|
let source_effective_balance = std::cmp::min(
|
||||||
*state
|
*state
|
||||||
.balances()
|
.balances()
|
||||||
.get(source_index)
|
.get(source_index)
|
||||||
.ok_or(BeaconStateError::UnknownValidator(source_index))?,
|
.ok_or(BeaconStateError::UnknownValidator(source_index))?,
|
||||||
max_effective_balance,
|
source_validator.effective_balance,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Move active balance to target. Excess balance is withdrawable.
|
// Move active balance to target. Excess balance is withdrawable.
|
||||||
|
|||||||
Reference in New Issue
Block a user