Merge pull request #1139 from terencechain/patch-76

Use get_total_balance for get_attestation_deltas
This commit is contained in:
Danny Ryan 2019-06-05 10:14:28 -06:00 committed by GitHub
commit 1daff359ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1407,7 +1407,7 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[List[Gwei], List[Gwei]]:
matching_head_attestations = get_matching_head_attestations(state, previous_epoch)
for attestations in (matching_source_attestations, matching_target_attestations, matching_head_attestations):
unslashed_attesting_indices = get_unslashed_attesting_indices(state, attestations)
attesting_balance = get_attesting_balance(state, attestations)
attesting_balance = get_total_balance(state, unslashed_attesting_indices)
for index in eligible_validator_indices:
if index in unslashed_attesting_indices:
rewards[index] += get_base_reward(state, index) * attesting_balance // total_balance