diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-04-04 18:18:34 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-04-04 18:18:34 +0800 |
commit | e9254bb0f9fd37759159712495e7e0893a882a92 (patch) | |
tree | a0507f52663316dd268e381512bada0c3d2fbd57 /miner | |
parent | 3a2da31c3e20c0566068fe01125ab1c676d04392 (diff) | |
download | dexon-e9254bb0f9fd37759159712495e7e0893a882a92.tar dexon-e9254bb0f9fd37759159712495e7e0893a882a92.tar.gz dexon-e9254bb0f9fd37759159712495e7e0893a882a92.tar.bz2 dexon-e9254bb0f9fd37759159712495e7e0893a882a92.tar.lz dexon-e9254bb0f9fd37759159712495e7e0893a882a92.tar.xz dexon-e9254bb0f9fd37759159712495e7e0893a882a92.tar.zst dexon-e9254bb0f9fd37759159712495e7e0893a882a92.zip |
core, miner: remove Frontier canary
Diffstat (limited to 'miner')
-rw-r--r-- | miner/worker.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/miner/worker.go b/miner/worker.go index a5e2516fe..c5fb82b45 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -351,19 +351,15 @@ func (self *worker) wait() { } } +// push sends a new work task to currently live miner agents. func (self *worker) push(work *Work) { - if atomic.LoadInt32(&self.mining) == 1 { - if core.Canary(work.state) { - glog.Infoln("Toxicity levels rising to deadly levels. Your canary has died. You can go back or continue down the mineshaft --more--") - glog.Infoln("You turn back and abort mining") - return - } - // push new work to agents - for agent := range self.agents { - atomic.AddInt32(&self.atWork, 1) - if agent.Work() != nil { - agent.Work() <- work - } + if atomic.LoadInt32(&self.mining) != 1 { + return + } + for agent := range self.agents { + atomic.AddInt32(&self.atWork, 1) + if ch := agent.Work(); ch != nil { + ch <- work } } } |