Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CalNumOfVoterToElect function to calculate the number of voter to elect #86

Merged
merged 8 commits into from
Jun 17, 2020
3 changes: 2 additions & 1 deletion types/voter_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/binary"
"fmt"
"math"
"sort"
"strings"

Expand Down Expand Up @@ -92,7 +93,7 @@ func (voters *VoterSet) Copy() *VoterSet {
}

// Forces recalculation of the set's total voting power.
// Panics if total voting power is bigger than MaxTotalStakingPower.
// Panics if total voting power is bigger than MaxTotalVotingPower.
func (voters *VoterSet) updateTotalVotingPower() {
sum := int64(0)
for _, val := range voters.Voters {
Expand Down