From 9f9223b50a05dde98344bfdc4022365b92a6d02e Mon Sep 17 00:00:00 2001 From: Ganesha Upadhyaya Date: Wed, 13 May 2020 16:12:30 -0700 Subject: [PATCH] fix signers share computation to use only non-harmony nodes (#3008) --- internal/chain/reward.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/chain/reward.go b/internal/chain/reward.go index 62b04ee72..9e56d41b6 100644 --- a/internal/chain/reward.go +++ b/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 {