miner

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain added in v1.3.0

type Chain interface {
	CurrentBlock() *types.Block
	MineBlock(int64)
}

type MineConfig

type MineConfig struct {
	SleepTime               int64 // 区块最小间隔时间
	Timeout                 int64 // 区块最大间隔时间
	ReservedPropagationTime int64 // 用于传播区块的最小预留时间
}

type MineInfo added in v1.4.0

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

type Miner

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

Miner 负责出块调度算法,决定什么时候该出块。本身并不负责区块封装的逻辑

func New

func New(cfg MineConfig, chain Chain, dm *deputynode.Manager, txPool TxPool) *Miner

func (*Miner) Close

func (m *Miner) Close()

func (*Miner) GetMinerAddress

func (m *Miner) GetMinerAddress() (common.Address, bool)

func (*Miner) IsMining

func (m *Miner) IsMining() bool

func (*Miner) Start

func (m *Miner) Start()

func (*Miner) Stop

func (m *Miner) Stop()

type TxPool added in v1.4.0

type TxPool interface {
	IsEmpty() bool
}

Jump to

Keyboard shortcuts

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