round

package
v0.18.2-canary Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Round

type Round struct {
	// contains filtered or unexported fields
}

Round keeps track of the current consensus state.

func New

func New(head *flow.Header, me module.Local, participants flow.IdentityList) (*Round, error)

New creates a new consensus round.

func (*Round) Candidate

func (r *Round) Candidate() *flow.Header

Candidate returns the current candidate header.

func (*Round) Leader

func (r *Round) Leader() *flow.Identity

Leader returns the the leader of the current round.

func (*Round) Parent

func (r *Round) Parent() *flow.Header

Parent returns the parent of the to-be-formed block.

func (*Round) Participants

func (r *Round) Participants() flow.IdentityList

Participants will retrieve cached identities for this round.

func (*Round) Propose

func (r *Round) Propose(candidate *flow.Header)

Propose sets the current candidate header.

func (*Round) Quorum

func (r *Round) Quorum() uint64

Quorum returns the quorum for a qualified majority in this round.

func (*Round) Tally

func (r *Round) Tally(voterID flow.Identifier, stake uint64)

Tally will add the given vote to the node tally.

func (*Round) Voted

func (r *Round) Voted(nodeID flow.Identifier) bool

Voted checks if the given node has already voted.

func (*Round) Votes

func (r *Round) Votes() uint64

Votes will count the total votes.

Jump to

Keyboard shortcuts

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