core, miner: remove Frontier canary

This commit is contained in:
Péter Szilágyi
2016-04-04 13:18:34 +03:00
parent 3a2da31c3e
commit e9254bb0f9
2 changed files with 8 additions and 63 deletions

View File

@ -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
}
}
}