cpuminer

package
v0.0.0-...-91a82d4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: LGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMiningTarget

func GetMiningTarget(difficulty *big.Int) *big.Int

GetMiningTarget returns the mining target for the specified difficulty.

Types

type CpuMiner

type CpuMiner struct {
}

func NewCpuMiner

func NewCpuMiner() *CpuMiner

func (*CpuMiner) Author

func (cm *CpuMiner) Author(header *types.BlockHeader) (utils.Address, error)

Author returning the header's miner as the proof-of-work verified author of the block.

func (*CpuMiner) CalcDifficulty

func (cm *CpuMiner) CalcDifficulty(chain consensus.IChainReader, config *params.ChainConfig, time uint64, parentHeader *types.BlockHeader) *big.Int

CalcDifficulty returns the difficulty that a new block should have when created at time given the parent block's time and difficulty.

func (*CpuMiner) Finalize

func (cm *CpuMiner) Finalize(chain consensus.IChainReader, header *types.BlockHeader, state *state.StateDB, txs []*types.Transaction, actions []*types.Action, receipts []*types.Receipt, dposContext *types.DposContext) (*types.Block, error)

Finalize .

func (*CpuMiner) Seal

func (cm *CpuMiner) Seal(chain consensus.IChainReader, block *types.Block, stop <-chan struct{}, threads int, updateHashes chan uint64) (*types.Block, error)

func (*CpuMiner) VerifySeal

func (cm *CpuMiner) VerifySeal(chain consensus.IChainReader, header *types.BlockHeader) error

VerifySeal checking whether the given block satisfies the PoW difficulty requirements.

Jump to

Keyboard shortcuts

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