fix signers share computation to use only non-harmony nodes (#3008)

pull/3014/head
Ganesha Upadhyaya 5 years ago committed by GitHub
parent 32dfea43a5
commit 9f9223b50a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      internal/chain/reward.go

@ -197,8 +197,11 @@ func AccumulateRewardsAndCountSigs(
allSignersShare := numeric.ZeroDec()
for j := range payable {
voterShare := votingPower.Voters[payable[j].BLSPublicKey].OverallPercent
allSignersShare = allSignersShare.Add(voterShare)
voter := votingPower.Voters[payable[j].BLSPublicKey]
if !voter.IsHarmonyNode {
voterShare := voter.OverallPercent
allSignersShare = allSignersShare.Add(voterShare)
}
}
for beaconMember := range payable {
// TODO Give out whatever leftover to the last voter/handle
@ -298,8 +301,11 @@ func AccumulateRewardsAndCountSigs(
allSignersShare := numeric.ZeroDec()
for j := range payableSigners {
voterShare := votingPower.Voters[payableSigners[j].BLSPublicKey].OverallPercent
allSignersShare = allSignersShare.Add(voterShare)
voter := votingPower.Voters[payableSigners[j].BLSPublicKey]
if !voter.IsHarmonyNode {
voterShare := voter.OverallPercent
allSignersShare = allSignersShare.Add(voterShare)
}
}
for j := range payableSigners {

Loading…
Cancel
Save