cmd/utils: fix archive mode detection for TransactionHistory override

This commit is contained in:
Vicky 2026-02-24 02:05:48 +08:00
parent 1625064c68
commit 07076c519d

View file

@ -1822,7 +1822,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
log.Warn("The flag --txlookuplimit is deprecated and will be removed, please use --history.transactions") log.Warn("The flag --txlookuplimit is deprecated and will be removed, please use --history.transactions")
cfg.TransactionHistory = ctx.Uint64(TxLookupLimitFlag.Name) cfg.TransactionHistory = ctx.Uint64(TxLookupLimitFlag.Name)
} }
if ctx.String(GCModeFlag.Name) == "archive" { if cfg.NoPruning {
if cfg.TransactionHistory != 0 { if cfg.TransactionHistory != 0 {
cfg.TransactionHistory = 0 cfg.TransactionHistory = 0
log.Warn("Disabled transaction unindexing for archive node") log.Warn("Disabled transaction unindexing for archive node")