Documentation ¶
Index ¶
- func CalcMaxFaultyNodes(s Validators) int
- type Validators
- func (v *Validators) Add(addr types.Address)
- func (v *Validators) CalcProposer(round uint64, lastProposer types.Address) types.Address
- func (v *Validators) Del(addr types.Address)
- func (v *Validators) Equal(vv *Validators) bool
- func (v *Validators) Includes(addr types.Address) bool
- func (v *Validators) Index(addr types.Address) int
- func (v *Validators) Len() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcMaxFaultyNodes ¶ added in v1.2.1
func CalcMaxFaultyNodes(s Validators) int
CalcMaxFaultyNodes returns the maximum number of allowed faulty nodes (F), based on the current validator set
Types ¶
type Validators ¶
func (*Validators) Add ¶
func (v *Validators) Add(addr types.Address)
Add adds a new address to the validator set
func (*Validators) CalcProposer ¶
CalcProposer calculates the address of the next proposer, from the validator set
func (*Validators) Del ¶
func (v *Validators) Del(addr types.Address)
Del removes an address from the validator set
func (*Validators) Equal ¶
func (v *Validators) Equal(vv *Validators) bool
Equal checks if 2 validator sets are equal
func (*Validators) Includes ¶
func (v *Validators) Includes(addr types.Address) bool
Includes checks if the address is in the validator set
Click to show internal directories.
Click to hide internal directories.