Skip to content

Commit

Permalink
fix: fix potential goroutine leak (bnb-chain#1067)
Browse files Browse the repository at this point in the history
  • Loading branch information
bittrainee authored Aug 31, 2022
1 parent f457598 commit b485651
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/state_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,14 @@ func (p *statePrefetcher) PrefetchMining(txs *types.TransactionsByPriceAndNonce,
if tx == nil {
return
}
txCh <- tx
txset.Shift()

select {
case <-interruptCh:
return
case txCh <- tx:
}

txset.Shift()
}
}
}(txs)
Expand Down

0 comments on commit b485651

Please sign in to comment.