From e299fa75ad53592c36305834ad928d84fa709074 Mon Sep 17 00:00:00 2001 From: meows Date: Fri, 2 Oct 2020 16:14:57 -0500 Subject: [PATCH] miner: exit loop when downloader Done or Failed Following the logic of the comment at the method, this fixes a regression introduced at 7cf56d6f064869cb62b1673f9ee437020c595391 , which would allow external parties to DoS with blocks, preventing mining progress. Signed-off-by: meows --- miner/miner.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miner/miner.go b/miner/miner.go index 8cbd70b424..4f8f76d4f9 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -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 {