aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2015-02-19 17:38:36 +0800
committerMaran <maran.hidskes@gmail.com>2015-02-19 17:38:36 +0800
commit5aff8bfb5918e53ba2590b25e6c17e1875870f6a (patch)
tree3961c734a18e1f517d49c0cebc76bbdcae964605 /miner
parentee9df32dba5091069cbdad8d00dc15738d676d5b (diff)
downloadgo-tangerine-5aff8bfb5918e53ba2590b25e6c17e1875870f6a.tar
go-tangerine-5aff8bfb5918e53ba2590b25e6c17e1875870f6a.tar.gz
go-tangerine-5aff8bfb5918e53ba2590b25e6c17e1875870f6a.tar.bz2
go-tangerine-5aff8bfb5918e53ba2590b25e6c17e1875870f6a.tar.lz
go-tangerine-5aff8bfb5918e53ba2590b25e6c17e1875870f6a.tar.xz
go-tangerine-5aff8bfb5918e53ba2590b25e6c17e1875870f6a.tar.zst
go-tangerine-5aff8bfb5918e53ba2590b25e6c17e1875870f6a.zip
Implement command line argument to set the amount of agents created by the miner
Defaults to the amount of cores available on the CPU
Diffstat (limited to 'miner')
-rw-r--r--miner/miner.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/miner/miner.go b/miner/miner.go
index 27afcf684..0cc2361c8 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -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()))
}