Documentation ¶
Index ¶
- func GetMiningTarget(difficulty *big.Int) *big.Int
- type CpuMiner
- func (cm *CpuMiner) Author(header *types.BlockHeader) (utils.Address, error)
- func (cm *CpuMiner) CalcDifficulty(chain consensus.IChainReader, config *params.ChainConfig, time uint64, ...) *big.Int
- func (cm *CpuMiner) Finalize(chain consensus.IChainReader, header *types.BlockHeader, state *state.StateDB, ...) (*types.Block, error)
- func (cm *CpuMiner) Seal(chain consensus.IChainReader, block *types.Block, stop <-chan struct{}, ...) (*types.Block, error)
- func (cm *CpuMiner) VerifySeal(chain consensus.IChainReader, header *types.BlockHeader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CpuMiner ¶
type CpuMiner struct { }
func NewCpuMiner ¶
func NewCpuMiner() *CpuMiner
func (*CpuMiner) Author ¶
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) VerifySeal ¶
func (cm *CpuMiner) VerifySeal(chain consensus.IChainReader, header *types.BlockHeader) error
VerifySeal checking whether the given block satisfies the PoW difficulty requirements.
Click to show internal directories.
Click to hide internal directories.