Versions in this module Expand all Collapse all v1 v1.1.1 Oct 29, 2019 Changes in this version + var LogTag = "blockproducer" + type Agent interface + GetHashRate func() int64 + SetReturnCh func(chan<- *Result) + Start func() + Stop func() + Work func() chan<- *Work + type Backend interface + AccountManager func() *accounts.Manager + BlockChain func() *blockchain.BlockChain + ChainDb func() database.IDatabase + TxPool func() *txprocessor.TxPool + type Blockproducer struct + func New(bchain Backend, config *params.ChainConfig, mux *event.TypeMux, ...) *Blockproducer + func (self *Blockproducer) GetProducerNewBlock(data *block.ConsensusData, timeLimit int64) *block.Block + func (self *Blockproducer) HashRate() (tot int64) + func (self *Blockproducer) Pending() (*block.Block, *state.StateDB) + func (self *Blockproducer) PendingBlock() *block.Block + func (self *Blockproducer) Producing() bool + func (self *Blockproducer) Register(agent Agent) + func (self *Blockproducer) SetCoinbase(addr types.Address) + func (self *Blockproducer) SetExtra(extra []byte) error + func (self *Blockproducer) SetPriKey(pri *ecdsa.PrivateKey) + func (self *Blockproducer) Start(coinbase types.Address) + func (self *Blockproducer) Stop() + func (self *Blockproducer) Unregister(agent Agent) + type CpuAgent struct + func NewCpuAgent(chain consensus.ChainReader, engine consensus.Engine) *CpuAgent + func (self *CpuAgent) GetHashRate() int64 + func (self *CpuAgent) SetReturnCh(ch chan<- *Result) + func (self *CpuAgent) Start() + func (self *CpuAgent) Stop() + func (self *CpuAgent) Work() chan<- *Work + type Result struct + Block *block.Block + Work *Work + type Work struct + Block *block.Block