aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-04-05 02:43:01 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-04-05 02:43:01 +0800
commit6a185531d2cd2003bb4352c391f9dca023894d5a (patch)
tree01c966d4c27e857d24cf87f5473d504a9a75ed96 /miner/worker.go
parent8d8e2248b2eb66a67cd2292a952acc53f73ba01f (diff)
parente9254bb0f9fd37759159712495e7e0893a882a92 (diff)
downloadgo-tangerine-6a185531d2cd2003bb4352c391f9dca023894d5a.tar.gz
go-tangerine-6a185531d2cd2003bb4352c391f9dca023894d5a.tar.zst
go-tangerine-6a185531d2cd2003bb4352c391f9dca023894d5a.zip
Merge pull request #2416 from karalabe/kill-canary
core, miner: remove Frontier canary
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
}
}
}