core, miner: fork resolving and restart miner after sync op

Fork resolving fixes #940
This commit is contained in:
obscuren
2015-05-15 15:30:34 +02:00
parent 82c0780f81
commit 5cec1aad15
2 changed files with 16 additions and 7 deletions

View File

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