cmd/utils: don't enumerate USB unless --usb is set (#22130)
USB enumeration still occured. Make sure it will only occur if --usb is set. This also deprecates the 'NoUSB' config file option in favor of a new option 'USB'.
This commit is contained in:
@ -1233,12 +1233,12 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
|
||||
if ctx.GlobalIsSet(LightKDFFlag.Name) {
|
||||
cfg.UseLightweightKDF = ctx.GlobalBool(LightKDFFlag.Name)
|
||||
}
|
||||
if ctx.GlobalIsSet(USBFlag.Name) {
|
||||
cfg.NoUSB = !ctx.GlobalBool(USBFlag.Name)
|
||||
}
|
||||
if ctx.GlobalIsSet(NoUSBFlag.Name) {
|
||||
if ctx.GlobalIsSet(NoUSBFlag.Name) || cfg.NoUSB {
|
||||
log.Warn("Option nousb is deprecated and USB is deactivated by default. Use --usb to enable")
|
||||
}
|
||||
if ctx.GlobalIsSet(USBFlag.Name) {
|
||||
cfg.USB = ctx.GlobalBool(USBFlag.Name)
|
||||
}
|
||||
if ctx.GlobalIsSet(InsecureUnlockAllowedFlag.Name) {
|
||||
cfg.InsecureUnlockAllowed = ctx.GlobalBool(InsecureUnlockAllowedFlag.Name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user