message

package
v0.0.0-...-8d456d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func NewMsgPool(cachedLen uint64, valNum, minVotesForQc int) *MsgPool

NewMsgPool initializes a msg pool to manage all of consensus votes for protocol

func (*MsgPool) CheckAnyVotes

func (mp *MsgPool) CheckAnyVotes(height uint64, round uint64) bool

CheckAnyVotes is an external api to check whether self have received minVotesForQc votes

func (*MsgPool) CheckVotesDone

func (mp *MsgPool) CheckVotesDone(height uint64, round uint64) ([]byte, bool, bool)

CheckVotesDone is an external api to check whether self have received enough votes for a valid block or change view

func (*MsgPool) Cleanup

func (mp *MsgPool) Cleanup()

Cleanup cleans up the cached messages

func (*MsgPool) GetLastValidRound

func (mp *MsgPool) GetLastValidRound(height uint64) int64

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

func (mp *MsgPool) GetQCVotes(height uint64, round uint64) []*maxbft.VoteData

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

func (mp *MsgPool) InsertVote(vote *maxbft.VoteData) (bool, error)

InsertVote is an external api to cache a vote msg with given height and round

func (*MsgPool) OnBlockSealed

func (mp *MsgPool) OnBlockSealed(height uint64)

OnBlockSealed is an external api to cleanup the old messages

func (*MsgPool) UpdateMinVotesForQc

func (mp *MsgPool) UpdateMinVotesForQc(msgPool *MsgPool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL