Skip to content

Commit 664903d

Browse files
authored
cmd/geth: usb is off by default (#21984)
1 parent 9584f56 commit 664903d

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

cmd/geth/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ var (
6868
utils.KeyStoreDirFlag,
6969
utils.ExternalSignerFlag,
7070
utils.NoUSBFlag,
71+
utils.USBFlag,
7172
utils.SmartCardDaemonPathFlag,
7273
utils.EthashCacheDirFlag,
7374
utils.EthashCachesInMemoryFlag,

cmd/geth/usage.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
3737
utils.DataDirFlag,
3838
utils.AncientFlag,
3939
utils.KeyStoreDirFlag,
40-
utils.NoUSBFlag,
40+
utils.USBFlag,
4141
utils.SmartCardDaemonPathFlag,
4242
utils.NetworkIdFlag,
4343
utils.GoerliFlag,
@@ -219,6 +219,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
219219
{
220220
Name: "ALIASED (deprecated)",
221221
Flags: append([]cli.Flag{
222+
utils.NoUSBFlag,
222223
utils.LegacyRPCEnabledFlag,
223224
utils.LegacyRPCListenAddrFlag,
224225
utils.LegacyRPCPortFlag,

cmd/utils/flags.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ var (
119119
}
120120
NoUSBFlag = cli.BoolFlag{
121121
Name: "nousb",
122-
Usage: "Disables monitoring for and managing USB hardware wallets",
122+
Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)",
123+
}
124+
USBFlag = cli.BoolFlag{
125+
Name: "usb",
126+
Usage: "Enable monitoring and management of USB hardware wallets",
123127
}
124128
SmartCardDaemonPathFlag = cli.StringFlag{
125129
Name: "pcscdpath",
@@ -1225,8 +1229,11 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
12251229
if ctx.GlobalIsSet(LightKDFFlag.Name) {
12261230
cfg.UseLightweightKDF = ctx.GlobalBool(LightKDFFlag.Name)
12271231
}
1232+
if ctx.GlobalIsSet(USBFlag.Name) {
1233+
cfg.NoUSB = !ctx.GlobalBool(USBFlag.Name)
1234+
}
12281235
if ctx.GlobalIsSet(NoUSBFlag.Name) {
1229-
cfg.NoUSB = ctx.GlobalBool(NoUSBFlag.Name)
1236+
log.Warn("Option nousb is deprecated and USB is deactivated by default. Use --usb to enable")
12301237
}
12311238
if ctx.GlobalIsSet(InsecureUnlockAllowedFlag.Name) {
12321239
cfg.InsecureUnlockAllowed = ctx.GlobalBool(InsecureUnlockAllowedFlag.Name)

0 commit comments

Comments
 (0)