cpuminer

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2018 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUMiner

type CPUMiner struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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, newBlockCh chan *bc.Hash) *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

func (m *CPUMiner) IsMining() bool

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

func (m *CPUMiner) NumWorkers() int32

NumWorkers returns the number of workers which are running to solve blocks.

This function is safe for concurrent access.

func (*CPUMiner) SetNumWorkers

func (m *CPUMiner) SetNumWorkers(numWorkers int32)

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.

func (*CPUMiner) Start

func (m *CPUMiner) Start()

Start begins the CPU mining process as well as the speed monitor used to track hashing metrics. Calling this function when the CPU miner has already been started will have no effect.

This function is safe for concurrent access.

func (*CPUMiner) Stop

func (m *CPUMiner) Stop()

Stop gracefully stops the mining process by signalling all workers, and the speed monitor to quit. Calling this function when the CPU miner has not already been started will have no effect.

This function is safe for concurrent access.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL