miner

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Miner

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

func New

func New(ctx *service.ServiceContext, api MinerAPI, engine consensus.Engine, interval uint32) *Miner

func (*Miner) GetWork

func (m *Miner) GetWork() (*consensus.MiningWork, error)

func (*Miner) HandleNewTip

func (m *Miner) HandleNewTip()

func (*Miner) Init

func (m *Miner) Init()

func (*Miner) IsMining

func (m *Miner) IsMining() bool

func (*Miner) SetMining

func (m *Miner) SetMining(mining bool)

TODO when p2p is syncing block how to stop miner.

func (*Miner) Stop

func (m *Miner) Stop()

func (*Miner) SubmitWork

func (m *Miner) SubmitWork(nonce uint64, hash, digest common.Hash) bool

type MinerAPI

type MinerAPI interface {
	CreateBlockToMine() (types.IBlock, error)
	InsertMinedBlock(types.IBlock) error
	GetTip() uint64
}

Jump to

Keyboard shortcuts

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