miner

package
v0.0.0-...-b2d87a2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHashMissMatch = errors.New("hash miss match")
	ErrNoNewBlock    = errors.New("no new block found")
)

Functions

This section is empty.

Types

type Miner

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

Miner 负责生产和同步区块

func NewMiner

func NewMiner(ctx *common.ChainCtx) *Miner

func (*Miner) IsExit

func (m *Miner) IsExit() bool

func (*Miner) ProcBlock deprecated

func (m *Miner) ProcBlock(_ xctx.XContext, _ *lpb.InternalBlock) error

Deprecated: 使用新的同步方案,这个函数仅用来兼容 处理P2P网络中接收到的区块

func (*Miner) Start

func (m *Miner) Start()

Start 启动矿工,周期检查矿工身份 同一时间,矿工状态是唯一的 0:休眠中 1:同步区块中 2:打包区块中

func (*Miner) Stop

func (m *Miner) Stop()

Stop 停止矿工

Jump to

Keyboard shortcuts

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