core/rawdb: fix ancient root folder (#29697)

This commit is contained in:
rjl493456442 2024-05-02 18:26:07 +08:00 committed by GitHub
parent 2c67fab0d7
commit 86a1f0c394
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -197,10 +197,11 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st
// Create the idle freezer instance. If the given ancient directory is empty,
// in-memory chain freezer is used (e.g. dev mode); otherwise the regular
// file-based freezer is created.
if ancient != "" {
ancient = resolveChainFreezerDir(ancient)
chainFreezerDir := ancient
if chainFreezerDir != "" {
chainFreezerDir = resolveChainFreezerDir(chainFreezerDir)
}
frdb, err := newChainFreezer(ancient, namespace, readonly)
frdb, err := newChainFreezer(chainFreezerDir, namespace, readonly)
if err != nil {
printChainMetadata(db)
return nil, err