From e9254bb0f9fd37759159712495e7e0893a882a92 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Mon, 4 Apr 2016 13:18:34 +0300 Subject: core, miner: remove Frontier canary --- miner/worker.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'miner/worker.go') 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 } } } -- cgit