From b8b95ec26b36c0c9e663b4503ad91a1915cb2784 Mon Sep 17 00:00:00 2001 From: jonny rhea <5555162+jrhea@users.noreply.github.com> Date: Tue, 3 Mar 2026 21:06:50 -0600 Subject: [PATCH] address review feedback --- miner/payload_building.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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")