miner: exit loop when downloader Done or Failed

Following the logic of the comment at the method,
this fixes a regression introduced at 7cf56d6f06
, which would allow external parties to DoS with
blocks, preventing mining progress.

Signed-off-by: meows <b5c6@protonmail.com>
This commit is contained in:
meows
2020-10-02 16:14:57 -05:00
parent 9d1e2027a0
commit e299fa75ad

View File

@@ -111,6 +111,8 @@ func (miner *Miner) update() {
miner.SetEtherbase(miner.coinbase)
miner.worker.start()
}
// stop immediately and ignore all further pending events
return
}
case addr := <-miner.startCh:
if canStart {