Implement command line argument to set the amount of agents created by the miner

Defaults to the amount of cores available on the CPU
This commit is contained in:
Maran
2015-02-19 10:38:36 +01:00
parent ee9df32dba
commit 5aff8bfb59
5 changed files with 23 additions and 17 deletions

View File

@ -20,13 +20,13 @@ type Miner struct {
mining bool
}
func New(coinbase []byte, eth core.Backend) *Miner {
func New(coinbase []byte, eth core.Backend, minerThreads int) *Miner {
miner := &Miner{
Coinbase: coinbase,
worker: newWorker(coinbase, eth),
}
for i := 0; i < 4; i++ {
for i := 0; i < minerThreads; i++ {
miner.worker.register(NewCpuMiner(i, ezp.New()))
}