core: check ancient empty

This commit is contained in:
jsvisa 2025-10-27 23:50:05 +08:00
parent 4bfad2651d
commit 44d3ae1e2d

View file

@ -177,7 +177,7 @@ func resolveChainFreezerDir(ancient string) string {
// - chain freezer exists in legacy location (root ancient folder)
freezer := filepath.Join(ancient, ChainFreezerName)
if !common.FileExist(freezer) {
if !common.FileExist(ancient) {
if !common.FileExist(ancient) || !common.IsNonEmptyDir(ancient) {
// The entire ancient store is not initialized, still use the sub
// folder for initialization.
} else {