From 4b45c5993c87d12c520a89e0d3d059e4d6b6eb9c Mon Sep 17 00:00:00 2001 From: lx <92799281+brilliant-lx@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:07:21 +0800 Subject: [PATCH] fix: skip HasState check for fast node (#1901) --- core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index b278844f4b..bb3320d252 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -358,7 +358,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis } // Make sure the state associated with the block is available head := bc.CurrentBlock() - if !bc.HasState(head.Root) { + if !bc.stateCache.NoTries() && !bc.HasState(head.Root) { // Head state is missing, before the state recovery, find out the // disk layer point of snapshot(if it's enabled). Make sure the // rewound point is lower than disk layer.