Versions in this module Expand all Collapse all v1 v1.0.0 Apr 12, 2019 Changes in this version + func GenVoteMsg(emptyBlock *model.Block, signFunc SignHashFunc, addr common.Address, ...) (*model.VoteMsg, error) + type AliveVerHaltHandler struct + func NewAliveVerHaltHandler(signFunc SignHashFunc, addr common.Address) *AliveVerHaltHandler + func (handler *AliveVerHaltHandler) OnMinimalHashBlock(selectedProposal ProposalMsg) (*model.VoteMsg, error) + type CsProtocolFunction interface + GetCurrentVerifierPeers func() map[string]chain_communication.PmAbstractPeer + GetNextVerifierPeers func() map[string]chain_communication.PmAbstractPeer + GetVerifierBootNode func() map[string]chain_communication.PmAbstractPeer + type HaltCheckConf struct + Broadcast broadcastEmptyBlock + CsProtocol CsProtocolFunction + EconomyModel economy_model.EconomyModel + NeedChainReader NeedChainReaderFunction + NodeType int + WalletSigner NeedWalletSigner + type NeedChainReaderFunction interface + BlockProcessor func(root common.Hash) (*chain.BlockProcessor, error) + BlockProcessorByNumber func(num uint64) (*chain.BlockProcessor, error) + BuildRegisterProcessor func(preRoot common.Hash) (*registerdb.RegisterDB, error) + CurrentBlock func() model.AbstractBlock + GetBlockByNumber func(number uint64) model.AbstractBlock + GetCurrVerifiers func() []common.Address + GetLastChangePoint func(block model.AbstractBlock) *uint64 + GetSeenCommit func(height uint64) []model.AbstractVerification + GetSlot func(block model.AbstractBlock) *uint64 + GetVerifiers func(round uint64) []common.Address + IsChangePoint func(block model.AbstractBlock, isProcessPackageBlock bool) bool + SaveBlock func(block model.AbstractBlock, seenCommits []model.AbstractVerification) error + type NeedWalletSigner interface + Evaluate func(account accounts.Account, seed []byte) (index [32]byte, proof []byte, err error) + GetAddress func() common.Address + PublicKey func() *ecdsa.PublicKey + SignHash func(hash []byte) ([]byte, error) + ValidSign func(hash []byte, pubKey []byte, sign []byte) error + type ProcessFunc func(block model.AbstractBlock, preStateRoot, preRegisterRoot common.Hash) (stateRoot, registerRoot common.Hash, err error) + type ProposalGenerator struct + func (g *ProposalGenerator) GenEmptyBlock() (*model.Block, error) + func (g *ProposalGenerator) GenProposal() (*ProposalMsg, error) + type ProposalGeneratorConfig struct + CurBlock model.AbstractBlock + LastVerifications []model.AbstractVerification + NewBlockProof []byte + NewBlockSeed common.Hash + ProcessStateFunc ProcessFunc + PubKey []byte + SignHashFunc SignHashFunc + VoteType model.VoteMsgType + type ProposalMsg struct + EmptyBlock model.Block + Round uint64 + VoteMsg model.VoteMsg + func GenProposalMsg(config ProposalGeneratorConfig) (*ProposalMsg, error) + type SignHashFunc func(hash []byte) ([]byte, error) + type StateHandler struct + func MakeHaltCheckStateHandler(needChainReader NeedChainReaderFunction, walletSigner NeedWalletSigner, ...) *StateHandler + func (haltCheckStateHandle *StateHandler) GenProposalConfig(voteType model.VoteMsgType) (ProposalGeneratorConfig, error) + func (haltCheckStateHandle *StateHandler) ProcessAccountAndRegisterState(block model.AbstractBlock, preStateRoot, preRegisterRoot common.Hash) (stateRoot, registerRoot common.Hash, err error) + func (haltCheckStateHandle *StateHandler) SaveFinalEmptyBlock(proposal ProposalMsg, votes map[common.Address]model.VoteMsg) error + type SystemHaltedCheck struct + SynStatus uint32 + func MakeSystemHaltedCheck(conf *HaltCheckConf) *SystemHaltedCheck + func (systemHaltedCheck *SystemHaltedCheck) MsgHandlers() map[uint64]func(msg p2p.Msg, p chain_communication.PmAbstractPeer) error + func (systemHaltedCheck *SystemHaltedCheck) Start() error + func (systemHaltedCheck *SystemHaltedCheck) Stop() + type VBHaltHandler struct + func NewHaltHandler(conf ProposalGeneratorConfig) *VBHaltHandler + func (handler *VBHaltHandler) GetMinProposalMsg() ProposalMsg + func (handler *VBHaltHandler) GetOtherProposalMessages() []ProposalMsg + func (handler *VBHaltHandler) GetProposalMsg() *ProposalMsg + func (handler *VBHaltHandler) HandlerAliveVerVotes(vote model.VoteMsg, currentVerifiers []common.Address) error + func (handler *VBHaltHandler) HandlerProposalMessages(msg ProposalMsg, selectedProposal chan ProposalMsg) error + func (handler *VBHaltHandler) MinProposalMsg() ProposalMsg + func (handler *VBHaltHandler) OnNewProposalMsg(msg ProposalMsg) error + func (handler *VBHaltHandler) ProposeEmptyBlock() (pm ProposalMsg, err error) + func (handler *VBHaltHandler) VotesLen() int