mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
address review feedback
This commit is contained in:
parent
30dd3dde58
commit
b8b95ec26b
1 changed files with 5 additions and 1 deletions
|
|
@ -260,7 +260,11 @@ func (miner *Miner) buildPayload(args *BuildPayloadArgs, witness bool) (*Payload
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-timer.C:
|
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 {
|
select {
|
||||||
case <-payload.stop:
|
case <-payload.stop:
|
||||||
log.Info("Stopping work on payload", "id", payload.id, "reason", "delivery")
|
log.Info("Stopping work on payload", "id", payload.id, "reason", "delivery")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue