Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUMiner ¶
CPUMiner provides facilities for solving blocks (mining) using the CPU in a concurrency-safe manner.
func NewCPUMiner ¶
func NewCPUMiner(c *protocol.Chain, accountManager *account.Manager, txPool *protocol.TxPool, dispatcher *event.Dispatcher) *CPUMiner
NewCPUMiner returns a new instance of a CPU miner for the provided configuration. Use Start to begin the mining process. See the documentation for CPUMiner type for more details.
func (*CPUMiner) IsMining ¶
IsMining returns whether or not the CPU miner has been started and is therefore currenting mining.
This function is safe for concurrent access.
func (*CPUMiner) NumWorkers ¶
NumWorkers returns the number of workers which are running to solve blocks.
This function is safe for concurrent access.
func (*CPUMiner) SetNumWorkers ¶
SetNumWorkers sets the number of workers to create which solve blocks. Any negative values will cause a default number of workers to be used which is based on the number of processor cores in the system. A value of 0 will cause all CPU mining to be stopped.
This function is safe for concurrent access.