func(api*MinerAPI)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*MinerAPI)SetGasLimit(gasLimithexutil.Uint64)bool{api.e.Miner().SetGasCeil(uint64(gasLimit))returntrue}// SetGasLimit sets the gaslimit to target towards during mining.
func(api*MinerAPI)SetGasPrice(gasPricehexutil.Big)bool{api.e.lock.Lock()api.e.gasPrice=(*big.Int)(&gasPrice)api.e.lock.Unlock()api.e.txPool.SetGasTip((*big.Int)(&gasPrice))returntrue}// SetGasPrice sets the minimum accepted gas price for the miner.
func(api*MinerAPI)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*MinerAPI)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.