diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-12 03:11:27 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-12 03:11:27 +0800 |
commit | 0bedf1c3760a1042171fdfde0f119acb683c43ec (patch) | |
tree | 2251978416ad615ee8ca5e465a5bf9ed5b74efed /miner/worker.go | |
parent | 59bc5412327469fd13534ee22eaeda91d79286f4 (diff) | |
parent | 48bd48876c02d1a08690b9604df09ef4bcf77838 (diff) | |
download | go-tangerine-0bedf1c3760a1042171fdfde0f119acb683c43ec.tar go-tangerine-0bedf1c3760a1042171fdfde0f119acb683c43ec.tar.gz go-tangerine-0bedf1c3760a1042171fdfde0f119acb683c43ec.tar.bz2 go-tangerine-0bedf1c3760a1042171fdfde0f119acb683c43ec.tar.lz go-tangerine-0bedf1c3760a1042171fdfde0f119acb683c43ec.tar.xz go-tangerine-0bedf1c3760a1042171fdfde0f119acb683c43ec.tar.zst go-tangerine-0bedf1c3760a1042171fdfde0f119acb683c43ec.zip |
Merge pull request #918 from obscuren/cpu_miner_fixes
cmd/geth, miner, backend, xeth: Fixed miner threads to be settable
Diffstat (limited to 'miner/worker.go')
-rw-r--r-- | miner/worker.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/miner/worker.go b/miner/worker.go index e3dbae717..d801a9839 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -141,7 +141,6 @@ func (self *worker) start() { for _, agent := range self.agents { agent.Start() } - } func (self *worker) stop() { @@ -149,10 +148,16 @@ func (self *worker) stop() { defer self.mu.Unlock() if atomic.LoadInt32(&self.mining) == 1 { + var keep []Agent // stop all agents for _, agent := range self.agents { agent.Stop() + // keep all that's not a cpu agent + if _, ok := agent.(*CpuAgent); !ok { + keep = append(keep, agent) + } } + self.agents = keep } atomic.StoreInt32(&self.mining, 0) |