Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
obscuren committed May 21, 2015
2 parents 2c1c78a + 054abe2 commit 13e662f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func New(eth core.Backend, mux *event.TypeMux, pow pow.PoW) *Miner {
// and halt your mining operation for as long as the DOS continues.
func (self *Miner) update() {
events := self.mux.Subscribe(downloader.StartEvent{}, downloader.DoneEvent{}, downloader.FailedEvent{})
out:
for ev := range events.Chan() {
switch ev.(type) {
case downloader.StartEvent:
Expand All @@ -62,11 +63,11 @@ 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 out
}
// unsubscribe. we're only interested in this event once
events.Unsubscribe()
// stop immediately and ignore all further pending events
break
}
}

Expand Down

0 comments on commit 13e662f

Please sign in to comment.