Documentation ¶
Index ¶
- Constants
- func CandidatesFromDB(sr protocol.StateReader, height uint64, loadCandidatesLegacy 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 ¶
func CandidatesFromDB(sr protocol.StateReader, height uint64, loadCandidatesLegacy bool, epochStartPoint bool) ([]*state.Candidate, uint64, error)
CandidatesFromDB returns array of Candidates in candidate pool of a given height or current epoch
func ConstructLegacyKey ¶
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 ¶
func ProbationListFromDB(sr protocol.StateReader, epochStartPoint bool) (*vote.ProbationList, uint64, error)
ProbationListFromDB returns array of probation list at current epoch
func UnproductiveDelegateFromDB ¶
func UnproductiveDelegateFromDB(sr protocol.StateReader) (*vote.UnproductiveDelegate, error)
UnproductiveDelegateFromDB returns latest UnproductiveDelegate struct
Types ¶
This section is empty.