address review feedback

This commit is contained in:
jonny rhea 2026-03-03 21:06:50 -06:00
parent 30dd3dde58
commit b8b95ec26b

View file

@ -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")