Documentation ¶
Index ¶
- Constants
- func CandidatesFromDB(sr protocol.StateReader, height uint64, beforeEaster bool, ...) ([]*state.Candidate, uint64, error)
- func ConstructKey(key string) hash.Hash256
- func ConstructLegacyKey(height uint64) hash.Hash160
- func GetMostRecentCandidateMap(sm protocol.StateManager, blkHeight uint64) (map[hash.Hash160]*state.Candidate, error)
- func LoadAndAddCandidates(sm protocol.StateManager, blkHeight uint64, addr string) error
- func ProbationListFromDB(sr protocol.StateReader, epochStartPoint bool) (*vote.ProbationList, uint64, error)
- func UnproductiveDelegateFromDB(sr protocol.StateReader) (*vote.UnproductiveDelegate, error)
Constants ¶
const CandidatesPrefix = "Candidates."
CandidatesPrefix is the prefix of the key of candidateList
const CurCandidateKey = "CurrentCandidateList."
CurCandidateKey is the key of current candidate list
const CurProbationKey = "CurrentKickoutKey."
CurProbationKey is the key of current probation list
const NxtCandidateKey = "NextCandidateList."
NxtCandidateKey is the key of next candidate list
const NxtProbationKey = "NextKickoutKey."
NxtProbationKey is the key of next probation list
const UnproductiveDelegateKey = "UnproductiveDelegateKey."
UnproductiveDelegateKey is the key of unproductive Delegate struct
Variables ¶
This section is empty.
Functions ¶
func CandidatesFromDB ¶ added in v0.11.0
func CandidatesFromDB(sr protocol.StateReader, height uint64, beforeEaster bool, epochStartPoint bool) ([]*state.Candidate, uint64, error)
CandidatesFromDB returns array of Candidates in candidate pool of a given height or current epoch
func ConstructLegacyKey ¶ added in v0.11.0
ConstructLegacyKey constructs a key for candidates storage (deprecated version)
func GetMostRecentCandidateMap ¶
func GetMostRecentCandidateMap(sm protocol.StateManager, blkHeight uint64) (map[hash.Hash160]*state.Candidate, error)
GetMostRecentCandidateMap gets the most recent candidateMap from trie
func LoadAndAddCandidates ¶
func LoadAndAddCandidates(sm protocol.StateManager, blkHeight uint64, addr string) error
LoadAndAddCandidates loads candidates from trie and adds a new candidate
func ProbationListFromDB ¶ added in v1.0.0
func ProbationListFromDB(sr protocol.StateReader, epochStartPoint bool) (*vote.ProbationList, uint64, error)
ProbationListFromDB returns array of probation list at current epoch
func UnproductiveDelegateFromDB ¶ added in v0.11.0
func UnproductiveDelegateFromDB(sr protocol.StateReader) (*vote.UnproductiveDelegate, error)
UnproductiveDelegateFromDB returns latest UnproductiveDelegate struct
Types ¶
This section is empty.