pengings

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: LGPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxKnownVotes              = 10000
	VotesLag                   = 3
	PropagateFutureVotesPeriod = 30
)
View Source
const (
	DeferFutureProposalsPeriod = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Proof

type Proof struct {
	Proof  []byte
	Hash   common.Hash
	PubKey []byte
	Round  uint64
}

type Proposals

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

func NewProposals

func NewProposals(chain *blockchain.Blockchain, detector *blockchain.OfflineDetector) (*Proposals, *sync.Map, *sync.Map)

func (*Proposals) AddProposeProof

func (proposals *Proposals) AddProposeProof(p []byte, hash common.Hash, pubKey []byte, round uint64) (added bool, pending bool)

func (*Proposals) AddProposedBlock

func (proposals *Proposals) AddProposedBlock(proposal *types.BlockProposal, peerId peer.ID, receivingTime time.Time) (added bool, pending bool)

func (*Proposals) AvgTimeDiff

func (proposals *Proposals) AvgTimeDiff(round uint64, start int64) decimal.Decimal

func (*Proposals) ClearPotentialForks

func (proposals *Proposals) ClearPotentialForks()

func (*Proposals) CompleteRound

func (proposals *Proposals) CompleteRound(height uint64)

func (*Proposals) GetBlockByHash

func (proposals *Proposals) GetBlockByHash(round uint64, hash common.Hash) (*types.Block, error)

func (*Proposals) GetForkedPeers

func (proposals *Proposals) GetForkedPeers() mapset.Set

func (*Proposals) GetProposedBlock

func (proposals *Proposals) GetProposedBlock(round uint64, proposerPubKey []byte, timeout time.Duration) (*types.Block, error)

func (*Proposals) GetProposerPubKey

func (proposals *Proposals) GetProposerPubKey(round uint64) []byte

func (*Proposals) HasPotentialFork

func (proposals *Proposals) HasPotentialFork() bool

func (*Proposals) ProcessPendingBlocks

func (proposals *Proposals) ProcessPendingBlocks() []*types.BlockProposal

func (*Proposals) ProcessPendingProofs

func (proposals *Proposals) ProcessPendingProofs() []*Proof

type Votes

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

func NewVotes

func NewVotes(state *appstate.AppState, bus eventbus.Bus, offlineDetector *blockchain.OfflineDetector) *Votes

func (*Votes) AddVote

func (votes *Votes) AddVote(vote *types.Vote) bool

func (*Votes) CompleteRound

func (votes *Votes) CompleteRound(round uint64)

func (*Votes) FutureBlockExist

func (votes *Votes) FutureBlockExist(round uint64, neccessaryVotes int) bool

func (*Votes) GetVoteByHash

func (votes *Votes) GetVoteByHash(hash common.Hash) *types.Vote

func (*Votes) GetVotesOfRound

func (votes *Votes) GetVotesOfRound(round uint64) *sync.Map

func (*Votes) Initialize

func (votes *Votes) Initialize(head *types.Header)

Jump to

Keyboard shortcuts

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