aboutsummaryrefslogtreecommitdiffstats
path: root/miner/miner.go
diff options
context:
space:
mode:
Diffstat (limited to 'miner/miner.go')
-rw-r--r--miner/miner.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/miner/miner.go b/miner/miner.go
index d46fabc1e..cf84c11f3 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -26,7 +26,11 @@ type Miner struct {
func New(eth core.Backend, pow pow.PoW, minerThreads int) *Miner {
// note: minerThreads is currently ignored because
// ethash is not thread safe.
- return &Miner{eth: eth, pow: pow, worker: newWorker(common.Address{}, eth)}
+ miner := &Miner{eth: eth, pow: pow, worker: newWorker(common.Address{}, eth)}
+ for i := 0; i < minerThreads; i++ {
+ miner.worker.register(NewCpuMiner(i, pow))
+ }
+ return miner
}
func (self *Miner) Mining() bool {
@@ -36,7 +40,6 @@ func (self *Miner) Mining() bool {
func (self *Miner) Start(coinbase common.Address) {
self.mining = true
self.worker.coinbase = coinbase
- self.worker.register(NewCpuMiner(0, self.pow))
self.pow.(*ethash.Ethash).UpdateDAG()