Skip to content

Commit

Permalink
Fixed panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozen committed Jul 24, 2024
1 parent 8098b29 commit 66d32e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion consensus/votepower/roster.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ func Compute(subComm *shard.Committee, epoch *big.Int) (*Roster, error) {
} else { // Our node
member.IsHarmonyNode = true
member.OverallPercent = harmonyPercent.Quo(asDecHMYSlotCount)
member.GroupPercent = member.OverallPercent.Quo(harmonyPercent)
if member.OverallPercent.IsZero() {
member.GroupPercent = member.OverallPercent.Copy()
} else {
member.GroupPercent = member.OverallPercent.Quo(harmonyPercent)
}
ourPercentage = ourPercentage.Add(member.OverallPercent)
}

Expand Down

0 comments on commit 66d32e6

Please sign in to comment.