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. 10
      internal/chain/reward.go

@ -197,9 +197,12 @@ func AccumulateRewardsAndCountSigs(
allSignersShare := numeric.ZeroDec()
for j := range payable {
voterShare := votingPower.Voters[payable[j].BLSPublicKey].OverallPercent
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
// what to do about share of those that didn't sign
@ -298,9 +301,12 @@ func AccumulateRewardsAndCountSigs(
allSignersShare := numeric.ZeroDec()
for j := range payableSigners {
voterShare := votingPower.Voters[payableSigners[j].BLSPublicKey].OverallPercent
voter := votingPower.Voters[payableSigners[j].BLSPublicKey]
if !voter.IsHarmonyNode {
voterShare := voter.OverallPercent
allSignersShare = allSignersShare.Add(voterShare)
}
}
for j := range payableSigners {
voter := votingPower.Voters[payableSigners[j].BLSPublicKey]

Loading…
Cancel
Save