func(api*PrivateMinerAPI)SetEtherbase(etherbasecommon.Address)bool{api.e.SetEtherbase(etherbase)returntrue}// SetEtherbase sets the etherbase of the miner
func(api*PrivateMinerAPI)SetExtra(extrastring)(bool,error){iferr:=api.e.Miner().SetExtra([// SetExtra sets the extra data string that is included when this miner mines a block.]byte(extra));err!=nil{returnfalse,err}returntrue,nil}
func(api*PrivateMinerAPI)SetGasPrice(gasPricehexutil.Big)bool{api.e.lock.Lock()api.e.gasPrice=(*big.Int)(&gasPrice)api.e.lock.Unlock()api.e.txPool.SetGasPrice((*big.Int)(&gasPrice))returntrue}// SetGasPrice sets the minimum accepted gas price for the miner.
func(api*PrivateMinerAPI)SetRecommitInterval(intervalint){api.e.Miner().SetRecommitInterval(time.Duration(interval)*time.Millisecond)}// SetRecommitInterval updates the interval for miner sealing work recommitting.
Start starts the miner with the given number of threads. If threads is nil, the number of workers started is equal to the number of logical CPUs that are usable by this process. If mining is already running, this method adjust the number of threads allowed to use and updates the minimum price required by the transaction pool.
func(api*PrivateMinerAPI)Start(threads*int)error{ifthreads==nil{returnapi.e.StartMining(runtime.NumCPU())}returnapi.e.StartMining(*threads)}// Start starts the miner with the given number of threads. If threads is nil,// the number of workers started is equal to the number of logical CPUs that are// usable by this process. If mining is already running, this method adjust the// number of threads allowed to use and updates the minimum price required by the// transaction pool.
func(api*PrivateMinerAPI)Stop(){api.e.StopMining()}// Stop terminates the miner, both at the consensus engine level as well as at// the block creation level.