Skip to content

Commit

Permalink
fix: waiting for the last simulation before pick best bid
Browse files Browse the repository at this point in the history
  • Loading branch information
irrun committed Jun 6, 2024
1 parent 75b7ac5 commit b96d494
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,13 +1337,16 @@ LOOP:
// when in-turn, compare with remote work.
from := bestWork.coinbase
if w.bidFetcher != nil && bestWork.header.Difficulty.Cmp(diffInTurn) == 0 {
waitBidTimer := time.NewTimer(w.config.DelayLeftOver / 5)
waitBidTimer := time.NewTimer(50 * time.Millisecond)
checkBidTicker := time.NewTicker(5 * time.Millisecond)
defer waitBidTimer.Stop()
defer checkBidTicker.Stop()
LOOP_WAIT_BID:
for {
select {
case <-waitBidTimer.C:
break LOOP_WAIT_BID
default:
case <-checkBidTicker.C:
if w.bidFetcher.GetSimulatingBid(bestWork.header.ParentHash) == nil {
break LOOP_WAIT_BID
}
Expand Down

0 comments on commit b96d494

Please sign in to comment.