Skip to content

Commit 13e662f

Browse files
committed
Merge branch 'develop'
2 parents 2c1c78a + 054abe2 commit 13e662f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

miner/miner.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func New(eth core.Backend, mux *event.TypeMux, pow pow.PoW) *Miner {
4545
// and halt your mining operation for as long as the DOS continues.
4646
func (self *Miner) update() {
4747
events := self.mux.Subscribe(downloader.StartEvent{}, downloader.DoneEvent{}, downloader.FailedEvent{})
48+
out:
4849
for ev := range events.Chan() {
4950
switch ev.(type) {
5051
case downloader.StartEvent:
@@ -62,11 +63,11 @@ func (self *Miner) update() {
6263
if shouldStart {
6364
self.Start(self.coinbase, self.threads)
6465
}
66+
// unsubscribe. we're only interested in this event once
67+
events.Unsubscribe()
68+
// stop immediately and ignore all further pending events
69+
break out
6570
}
66-
// unsubscribe. we're only interested in this event once
67-
events.Unsubscribe()
68-
// stop immediately and ignore all further pending events
69-
break
7071
}
7172
}
7273

0 commit comments

Comments
 (0)