spow

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: LGPL-3.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RestTime = 50 * time.Millisecond
)

Functions

This section is empty.

Types

type API

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

func (*API) GetThreads

func (api *API) GetThreads() int

GetThreads returns the thread number of the miner engine

type HashItem

type HashItem struct {
	//Hash  common.Hash
	Slice uint64
	Nonce uint64
}

type SpowEngine

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

Engine provides the consensus operations based on SPOW.

func NewSpowEngine

func NewSpowEngine(threads int, folder string, percentage int) *SpowEngine

func (*SpowEngine) APIs

func (engine *SpowEngine) APIs(chain consensus.ChainReader) []rpc.API

func (*SpowEngine) GetMiningTarget added in v1.3.0

func (engine *SpowEngine) GetMiningTarget(block *types.Block) *big.Int

GetMiningTarget get mining target for the specific block

func (*SpowEngine) MSeal

func (engine *SpowEngine) MSeal(reader consensus.ChainReader, block *types.Block, stop <-chan struct{}, results chan<- *types.Block) error

func (*SpowEngine) MStartMining

func (engine *SpowEngine) MStartMining(block *types.Block, seed uint64, min uint64, max uint64, result chan<- *types.Block, abort <-chan struct{},
	isNonceFound *int32, once *sync.Once, hashrate metrics.Meter, log *log.SeeleLog)

func (*SpowEngine) Prepare

func (engine *SpowEngine) Prepare(reader consensus.ChainReader, header *types.BlockHeader) error

func (*SpowEngine) Seal

func (engine *SpowEngine) Seal(reader consensus.ChainReader, block *types.Block, stop <-chan struct{}, results chan<- *types.Block) error

func (*SpowEngine) SetThreads

func (engine *SpowEngine) SetThreads(threads int)

func (*SpowEngine) VerifyHeader

func (engine *SpowEngine) VerifyHeader(reader consensus.ChainReader, header *types.BlockHeader) error

ValidateHeader validates the specified header and returns error if validation failed.

Jump to

Keyboard shortcuts

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