Skip to content

Commit

Permalink
fix(cmd): check pruneancient when creating db (bnb-chain#1986)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann authored and flywukong committed Nov 22, 2023
1 parent a4eee3b commit 8e13349
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8e13349

Please sign in to comment.