consensus

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxStoredAvgTimeDiffs = 20
)

Variables

View Source
var (
	ForkDetected = errors.New("fork is detected")
)

Functions

This section is empty.

Types

type Engine

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

func NewEngine

func NewEngine(chain *blockchain.Blockchain, gossipHandler *protocol.IdenaGossipHandler, proposals *pengings.Proposals, config *config.ConsensusConf,
	appState *appstate.AppState,
	votes *pengings.Votes,
	txpool *mempool.TxPool, secStore *secstore.SecStore, downloader *protocol.Downloader,
	offlineDetector *blockchain.OfflineDetector,
	statsCollector collector.StatsCollector) *Engine

func (*Engine) GetProcess

func (engine *Engine) GetProcess() string

func (*Engine) ReadonlyAppState

func (engine *Engine) ReadonlyAppState() (*appstate.AppState, error)

func (*Engine) Start

func (engine *Engine) Start()

func (*Engine) Synced

func (engine *Engine) Synced() bool

type ForkDetector

type ForkDetector interface {
	HasPotentialFork() bool
	GetForkedPeers() mapset.Set
	ClearPotentialForks()
}

type ForkResolver

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

func NewForkResolver

func NewForkResolver(forkDetectors []ForkDetector, downloader *protocol.Downloader, chain *blockchain.Blockchain,
	statsCollector collector.StatsCollector) *ForkResolver

func (*ForkResolver) ApplyFork

func (resolver *ForkResolver) ApplyFork() error

func (*ForkResolver) HasLoadedFork

func (resolver *ForkResolver) HasLoadedFork() bool

func (*ForkResolver) Start

func (resolver *ForkResolver) Start()

type ForwardPeersProvider

type ForwardPeersProvider interface {
	PotentialForwardPeers(round uint64) []peer.ID
	PeerHeights() []uint64
}

Jump to

Keyboard shortcuts

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