mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
cmd/utils: fix command line flag resolve (#20167)
In Geth, we have two sources for configuration: (1) Config file (2) Command line flag Basically geth will first resolve config file and then overwrite configs with command line flags. This issue is: geth should only overwrite configs if flags are truly set. So before we apply any flag to configs, `GlobalIsSet` check is necessary.
This commit is contained in:
parent
17fb199c46
commit
aae4f616e4
@ -1487,7 +1487,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
|
||||
if gcmode := ctx.GlobalString(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" {
|
||||
Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name)
|
||||
}
|
||||
cfg.NoPruning = ctx.GlobalString(GCModeFlag.Name) == "archive"
|
||||
if ctx.GlobalIsSet(GCModeFlag.Name) {
|
||||
cfg.NoPruning = ctx.GlobalString(GCModeFlag.Name) == "archive"
|
||||
}
|
||||
cfg.BlocksBeforePruning = ctx.GlobalUint64(GCModeLimitFlag.Name)
|
||||
cfg.BlocksToPrune = ctx.GlobalUint64(GCModeBlockToPruneFlag.Name)
|
||||
cfg.PruningTimeout = ctx.GlobalDuration(GCModeTickTimeout.Name)
|
||||
|
Loading…
Reference in New Issue
Block a user