miner: fix data race during shutdown (#23435)
This fixes a data race on worker.current by moving the call to StopPrefetcher into the main loop. The commit also contains fixes for two other races in unit tests of unrelated packages.
This commit is contained in:
committed by
GitHub
parent
28d30b51f8
commit
ee120ef865
@@ -151,7 +151,7 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool) *testBacke
|
||||
// Construct testing chain
|
||||
diskdb := rawdb.NewMemoryDatabase()
|
||||
gspec.Commit(diskdb)
|
||||
chain, err := core.NewBlockChain(diskdb, nil, gspec.Config, engine, vm.Config{}, nil, nil)
|
||||
chain, err := core.NewBlockChain(diskdb, &core.CacheConfig{TrieCleanNoPrefetch: true}, gspec.Config, engine, vm.Config{}, nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create local chain, %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user