Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (16 sloc) 423 Bytes
package consensus
import (
"sort"
"boscoin.io/sebak/lib/network"
)
type ProposerSelector interface {
Select(uint64, uint64) string
}
type SequentialSelector struct {
cm network.ConnectionManager
}
func (s SequentialSelector) Select(blockHeight uint64, round uint64) string {
candidates := sort.StringSlice(s.cm.AllValidators())
candidates.Sort()
return candidates[(blockHeight+round)%uint64(len(candidates))]
}
You can’t perform that action at this time.