From 6e652693368e5a153cf81ff1083f45746255d195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CGheisMohammadi=E2=80=9D?= <36589218+GheisMohammadi@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:17:23 +0800 Subject: [PATCH] return back wrongly deleted lines --- core/blockchain_impl.go | 1 + core/state/snapshot/snapshot.go | 1 + node/worker/worker_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/core/blockchain_impl.go b/core/blockchain_impl.go index 73878387e..d71371986 100644 --- a/core/blockchain_impl.go +++ b/core/blockchain_impl.go @@ -262,6 +262,7 @@ func newBlockChainWithOptions( if stateCache == nil { stateCache = state.NewDatabaseWithNodeDB(db, triedb) } + bodyCache, _ := lru.New(bodyCacheLimit) bodyRLPCache, _ := lru.New(bodyCacheLimit) receiptsCache, _ := lru.New(receiptsCacheLimit) diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index 210fcac62..d294ff185 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -206,6 +206,7 @@ func New(config Config, diskdb ethdb.KeyValueStore, triedb *trie.Database, root utils.Logger().Warn().Err(err).Msg("Snapshot maintenance disabled (syncing)") return snap, nil } + // Create the building waiter if the background generation is allowed if !config.NoBuild && !config.AsyncBuild { defer snap.waitBuild() diff --git a/node/worker/worker_test.go b/node/worker/worker_test.go index bc5c0a1cf..8dc84e14e 100644 --- a/node/worker/worker_test.go +++ b/node/worker/worker_test.go @@ -46,6 +46,7 @@ func TestNewWorker(t *testing.T) { _ = genesis cacheConfig := &core.CacheConfig{SnapshotLimit: 0} chain, err := core.NewBlockChain(database, nil, &core.BlockChainImpl{}, cacheConfig, gspec.Config, engine, vm.Config{}) + if err != nil { t.Error(err) }