cmd/utils: fix disabling cache preimages through config file

This commit is contained in:
cuiweixie 2025-11-30 13:07:23 +08:00
parent 5d51208334
commit 6369c7b175
No known key found for this signature in database
GPG key ID: 16DF64EE15E495A3

View file

@ -1683,8 +1683,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.IsSet(CacheNoPrefetchFlag.Name) {
cfg.NoPrefetch = ctx.Bool(CacheNoPrefetchFlag.Name)
}
// Read the value from the flag no matter if it's set or not.
if ctx.IsSet(CachePreimagesFlag.Name) {
cfg.Preimages = ctx.Bool(CachePreimagesFlag.Name)
}
if cfg.NoPruning && !cfg.Preimages {
cfg.Preimages = true
log.Info("Enabling recording of key preimages since archive mode is used")