mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-28 08:37:22 +00:00
core/state: fix prefetch on single core CPU (#32075)
We need at least one prefetch goroutine. SetLimit(0) would block prefetch. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
6eab053088
commit
338d754ed0
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c
|
|||
workers errgroup.Group
|
||||
reader = statedb.Reader()
|
||||
)
|
||||
workers.SetLimit(4 * runtime.NumCPU() / 5) // Aggressively run the prefetching
|
||||
workers.SetLimit(max(1, 4*runtime.NumCPU()/5)) // Aggressively run the prefetching
|
||||
|
||||
// Iterate over and process the individual transactions
|
||||
for i, tx := range block.Transactions() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue