miner

package
v0.0.0-...-b78b3a4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	BlockChain() *core.BlockChain
	TxPool() *core.TxPool
}

后端包装挖掘所需的所有方法。

type Miner

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

Miner创建块并搜索工作证明值。

func New

func New(eth Backend, config *params.ChainConfig, mux *event.TypeMux, engine consensus.Engine, recommit time.Duration) *Miner

func (*Miner) Close

func (self *Miner) Close()

func (*Miner) HashRate

func (self *Miner) HashRate() uint64

func (*Miner) Mining

func (self *Miner) Mining() bool

func (*Miner) Pending

func (self *Miner) Pending() (*types.Block, *state.StateDB)

挂起返回当前挂起的块和关联状态。

func (*Miner) PendingBlock

func (self *Miner) PendingBlock() *types.Block

PendingBlock返回当前挂起的块。

注意,要访问挂起块和挂起状态 同时,请使用pending(),因为pending状态可以 在多个方法调用之间切换

func (*Miner) SetCoinbase

func (self *Miner) SetCoinbase(addr common.Address)

func (*Miner) SetExtra

func (self *Miner) SetExtra(extra []byte) error

func (*Miner) Start

func (self *Miner) Start(coinbase common.Address, blcokInterval uint64)

func (*Miner) Stop

func (self *Miner) Stop()

Jump to

Keyboard shortcuts

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