diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-16 06:02:22 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-16 06:02:22 +0800 |
commit | d116b9595cf6424293cc94d0dbe78153da860727 (patch) | |
tree | d855d927424171b258f14598d451c982d9c25736 /miner | |
parent | 82c0780f81bef8c88db9dff4bb34917f2934c71d (diff) | |
parent | 55d85d60fdad2cbd7947d87b2a81bd8df6a18025 (diff) | |
download | go-tangerine-d116b9595cf6424293cc94d0dbe78153da860727.tar go-tangerine-d116b9595cf6424293cc94d0dbe78153da860727.tar.gz go-tangerine-d116b9595cf6424293cc94d0dbe78153da860727.tar.bz2 go-tangerine-d116b9595cf6424293cc94d0dbe78153da860727.tar.lz go-tangerine-d116b9595cf6424293cc94d0dbe78153da860727.tar.xz go-tangerine-d116b9595cf6424293cc94d0dbe78153da860727.tar.zst go-tangerine-d116b9595cf6424293cc94d0dbe78153da860727.zip |
Merge pull request #989 from obscuren/develop
core, miner: fork resolving and restart miner after sync op
Diffstat (limited to 'miner')
-rw-r--r-- | miner/miner.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/miner/miner.go b/miner/miner.go index 359be4032..19d39a605 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -47,6 +47,7 @@ func (self *Miner) update() { atomic.StoreInt32(&self.canStart, 0) if self.Mining() { self.Stop() + atomic.StoreInt32(&self.shouldStart, 1) glog.V(logger.Info).Infoln("Mining operation aborted due to sync operation") } case downloader.DoneEvent, downloader.FailedEvent: @@ -100,7 +101,7 @@ func (self *Miner) Stop() { } func (self *Miner) Register(agent Agent) { - if atomic.LoadInt32(&self.mining) == 0 { + if self.Mining() { agent.Start() } |