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