mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
cmd/utils: fix handling of boolean flags when they are set to false (#33338)
geth --nodiscover=false may result in ctx.IsSet(NoDiscoverFlag.Name) is true, but cfg. NoDiscovery should be false, not true.
This commit is contained in:
parent
042c47ce1a
commit
be94ea1c40
1 changed files with 2 additions and 2 deletions
|
|
@ -1374,7 +1374,7 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
|||
cfg.MaxPendingPeers = ctx.Int(MaxPendingPeersFlag.Name)
|
||||
}
|
||||
if ctx.IsSet(NoDiscoverFlag.Name) {
|
||||
cfg.NoDiscovery = true
|
||||
cfg.NoDiscovery = ctx.Bool(NoDiscoverFlag.Name)
|
||||
}
|
||||
|
||||
flags.CheckExclusive(ctx, DiscoveryV4Flag, NoDiscoverFlag)
|
||||
|
|
@ -1724,7 +1724,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
|||
cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name)
|
||||
}
|
||||
if ctx.IsSet(LogNoHistoryFlag.Name) {
|
||||
cfg.LogNoHistory = true
|
||||
cfg.LogNoHistory = ctx.Bool(LogNoHistoryFlag.Name)
|
||||
}
|
||||
if ctx.IsSet(LogSlowBlockFlag.Name) {
|
||||
cfg.SlowBlockThreshold = ctx.Duration(LogSlowBlockFlag.Name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue