mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 13:07:18 +00:00
Update fork_choice for v0.6.1
This commit is contained in:
parent
e310bdd904
commit
4287891026
@ -83,10 +83,8 @@ impl<T: Store, E: EthSpec> BitwiseLMDGhost<T, E> {
|
||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||
|
||||
for index in active_validator_indices {
|
||||
let balance = std::cmp::min(
|
||||
current_state.validator_balances[index],
|
||||
spec.max_deposit_amount,
|
||||
) / spec.fork_choice_balance_increment;
|
||||
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||
/ spec.effective_balance_increment;
|
||||
if balance > 0 {
|
||||
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
||||
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
||||
|
@ -83,10 +83,8 @@ impl<T: Store, E: EthSpec> OptimizedLMDGhost<T, E> {
|
||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||
|
||||
for index in active_validator_indices {
|
||||
let balance = std::cmp::min(
|
||||
current_state.validator_balances[index],
|
||||
spec.max_deposit_amount,
|
||||
) / spec.fork_choice_balance_increment;
|
||||
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||
/ spec.effective_balance_increment;
|
||||
if balance > 0 {
|
||||
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
||||
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
||||
|
@ -52,10 +52,8 @@ impl<T: Store, E: EthSpec> SlowLMDGhost<T, E> {
|
||||
current_state.get_active_validator_indices(block_slot.epoch(spec.slots_per_epoch));
|
||||
|
||||
for index in active_validator_indices {
|
||||
let balance = std::cmp::min(
|
||||
current_state.validator_balances[index],
|
||||
spec.max_deposit_amount,
|
||||
) / spec.fork_choice_balance_increment;
|
||||
let balance = std::cmp::min(current_state.balances[index], spec.max_effective_balance)
|
||||
/ spec.effective_balance_increment;
|
||||
if balance > 0 {
|
||||
if let Some(target) = self.latest_attestation_targets.get(&(index as u64)) {
|
||||
*latest_votes.entry(*target).or_insert_with(|| 0) += balance;
|
||||
|
Loading…
Reference in New Issue
Block a user