Update fork_choice for v0.6.1

This commit is contained in:
Paul Hauner 2019-06-02 14:14:30 +10:00
parent e310bdd904
commit 4287891026
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C
3 changed files with 6 additions and 12 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;