From 8b94dd6b5929f26c24701ed5074b490e7d4e23ab Mon Sep 17 00:00:00 2001 From: Ng Wei Han <47109095+weiihann@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:10:41 +0800 Subject: [PATCH] fix(cmd): check pruneancient when creating db (#1986) --- cmd/utils/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 36455d86b..7c6ce0e6c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -2355,7 +2355,7 @@ func tryMakeReadOnlyDatabase(ctx *cli.Context, stack *node.Node) ethdb.Database // If datadir doesn't exist we need to open db in write-mode // so database engine can create files. readonly := true - if !common.FileExist(stack.ResolvePath("chaindata")) { + if !common.FileExist(stack.ResolvePath("chaindata")) || ctx.Bool(PruneAncientDataFlag.Name) { readonly = false } return MakeChainDatabase(ctx, stack, readonly, false)