From 88c7f2b249a66fe659479fcb6e9f72232ea80196 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Thu, 21 May 2015 19:51:34 +0200 Subject: [PATCH] wait for a downloader done/failed event before breaking the miner update loop --- miner/miner.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/miner/miner.go b/miner/miner.go index 4e99245f8c..e735f565e6 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -62,11 +62,12 @@ func (self *Miner) update() { if shouldStart { self.Start(self.coinbase, self.threads) } + + // unsubscribe. we're only interested in this event once + events.Unsubscribe() + // stop immediately and ignore all further pending events + break } - // unsubscribe. we're only interested in this event once - events.Unsubscribe() - // stop immediately and ignore all further pending events - break } }