From d2b4abf9340062c7ac49b6adb4b6fce539bcf399 Mon Sep 17 00:00:00 2001 From: ucwong Date: Thu, 25 Aug 2022 05:04:57 +0800 Subject: [PATCH] core/blockchain:fix txs reindex after reindex from ancients crashed --- core/blockchain.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index a98c3b4dbeb..9ca9c44036d 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -276,12 +276,12 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par if bc.empty() { rawdb.InitDatabaseFromFreezer(bc.db) - // If ancient database is not empty, reconstruct all missing - // indices in the background. - frozen, _ := bc.db.Ancients() - if frozen > 0 { - txIndexBlock = frozen - } + } + // If ancient database is not empty, reconstruct all missing + // indices in the background. + frozen, _ := bc.db.Ancients() + if frozen > 0 { + txIndexBlock = frozen } if err := bc.loadLastState(); err != nil { return nil, err