Documentation ¶
Index ¶
- func ValidateMessageBasicInfo(payload *maxbft.ConsensusPayload) error
- type MsgPool
- func (mp *MsgPool) CheckAnyVotes(height uint64, round uint64) bool
- func (mp *MsgPool) CheckVotesDone(height uint64, round uint64) ([]byte, bool, bool)
- func (mp *MsgPool) Cleanup()
- func (mp *MsgPool) GetLastValidRound(height uint64) int64
- func (mp *MsgPool) GetProposal(height uint64, round uint64) *maxbft.ConsensusMsg
- func (mp *MsgPool) GetQCVotes(height uint64, round uint64) []*maxbft.VoteData
- func (mp *MsgPool) InsertProposal(msg *maxbft.ConsensusMsg) (bool, error)
- func (mp *MsgPool) InsertVote(vote *maxbft.VoteData) (bool, error)
- func (mp *MsgPool) OnBlockSealed(height uint64)
- func (mp *MsgPool) UpdateMinVotesForQc(msgPool *MsgPool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateMessageBasicInfo ¶
func ValidateMessageBasicInfo(payload *maxbft.ConsensusPayload) error
ValidateMessageBasicInfo is an external api to check a msg's basic info
Types ¶
type MsgPool ¶
type MsgPool struct {
// contains filtered or unexported fields
}
MsgPool manages all of consensus messages received for protocol
func NewMsgPool ¶
NewMsgPool initializes a msg pool to manage all of consensus votes for protocol
func (*MsgPool) CheckAnyVotes ¶
CheckAnyVotes is an external api to check whether self have received minVotesForQc votes
func (*MsgPool) CheckVotesDone ¶
CheckVotesDone is an external api to check whether self have received enough votes for a valid block or change view
func (*MsgPool) GetLastValidRound ¶
GetLastValidRound is an external api to get latest valid round at height
func (*MsgPool) GetProposal ¶
func (mp *MsgPool) GetProposal(height uint64, round uint64) *maxbft.ConsensusMsg
GetProposal is an external api to get a proposal with given height and round
func (*MsgPool) GetQCVotes ¶
GetQCVotes is an external api to get votes at given height and round
func (*MsgPool) InsertProposal ¶
func (mp *MsgPool) InsertProposal(msg *maxbft.ConsensusMsg) (bool, error)
func (*MsgPool) InsertVote ¶
InsertVote is an external api to cache a vote msg with given height and round
func (*MsgPool) OnBlockSealed ¶
OnBlockSealed is an external api to cleanup the old messages