diff --git a/miner/payload_building.go b/miner/payload_building.go index a008792382..8bd9552338 100644 --- a/miner/payload_building.go +++ b/miner/payload_building.go @@ -260,7 +260,11 @@ func (miner *Miner) buildPayload(args *BuildPayloadArgs, witness bool) (*Payload for { select { case <-timer.C: - // Select is random, so we need to check if the payload has been stopped + // When block building takes close to the full recommit interval, + // the timer fires near-instantly on the next iteration. If the + // payload was resolved during that build, both timer.C and + // payload.stop are ready and Go's select picks one at random. + // Check payload.stop first to avoid an unnecessary generateWork. select { case <-payload.stop: log.Info("Stopping work on payload", "id", payload.id, "reason", "delivery")