aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go20
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
}
}
}