From a6e42641a2c08330a16337f566e1ffd82422b444 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 1 Jul 2022 10:58:04 +0800 Subject: [PATCH] skip the ancient check when prunning turned on --- core/rawdb/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rawdb/database.go b/core/rawdb/database.go index e660189f8b..bd7683babc 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -194,7 +194,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, freezer string, namespace st // validate in this method. If, however, the genesis hash is not nil, compare // it to the freezer content. // TODO consider deprecate this check - if kvgenesis, _ := db.Get(headerHashKey(0)); len(kvgenesis) > 0 { + if kvgenesis, _ := db.Get(headerHashKey(0)); len(kvgenesis) > 0 && !ancientPrune { if frozen, _ := frdb.Ancients(); frozen > 0 { // If the freezer already contains something, ensure that the genesis blocks // match, otherwise we might mix up freezers across chains and destroy both