Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
5aa21d8b
Commit
5aa21d8b
authored
8 years ago
by
Péter Szilágyi
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14357 from karalabe/nousb-flag
cmd, node: add --nousb and node.Config.NoUSB to disable hw wallets
parents
9fc90b67
6430e672
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
main.go
cmd/geth/main.go
+1
-0
usage.go
cmd/geth/usage.go
+1
-0
flags.go
cmd/utils/flags.go
+7
-0
config.go
node/config.go
+9
-4
No files found.
cmd/geth/main.go
View file @
5aa21d8b
...
...
@@ -88,6 +88,7 @@ func init() {
utils
.
BootnodesFlag
,
utils
.
DataDirFlag
,
utils
.
KeyStoreDirFlag
,
utils
.
NoUSBFlag
,
utils
.
EthashCacheDirFlag
,
utils
.
EthashCachesInMemoryFlag
,
utils
.
EthashCachesOnDiskFlag
,
...
...
This diff is collapsed.
Click to expand it.
cmd/geth/usage.go
View file @
5aa21d8b
...
...
@@ -67,6 +67,7 @@ var AppHelpFlagGroups = []flagGroup{
configFileFlag
,
utils
.
DataDirFlag
,
utils
.
KeyStoreDirFlag
,
utils
.
NoUSBFlag
,
utils
.
NetworkIdFlag
,
utils
.
TestNetFlag
,
utils
.
DevModeFlag
,
...
...
This diff is collapsed.
Click to expand it.
cmd/utils/flags.go
View file @
5aa21d8b
...
...
@@ -115,6 +115,10 @@ var (
Name
:
"keystore"
,
Usage
:
"Directory for the keystore (default = inside the datadir)"
,
}
NoUSBFlag
=
cli
.
BoolFlag
{
Name
:
"nousb"
,
Usage
:
"Disables monitoring for and managine USB hardware wallets"
,
}
EthashCacheDirFlag
=
DirectoryFlag
{
Name
:
"ethash.cachedir"
,
Usage
:
"Directory to store the ethash verification caches (default = inside the datadir)"
,
...
...
@@ -729,6 +733,9 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
if
ctx
.
GlobalIsSet
(
LightKDFFlag
.
Name
)
{
cfg
.
UseLightweightKDF
=
ctx
.
GlobalBool
(
LightKDFFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
NoUSBFlag
.
Name
)
{
cfg
.
NoUSB
=
ctx
.
GlobalBool
(
NoUSBFlag
.
Name
)
}
}
func
setGPO
(
ctx
*
cli
.
Context
,
cfg
*
gasprice
.
Config
)
{
...
...
This diff is collapsed.
Click to expand it.
node/config.go
View file @
5aa21d8b
...
...
@@ -82,6 +82,9 @@ type Config struct {
// scrypt KDF at the expense of security.
UseLightweightKDF
bool
`toml:",omitempty"`
// NoUSB disables hardware wallet monitoring and connectivity.
NoUSB
bool
`toml:",omitempty"`
// IPCPath is the requested location to place the IPC endpoint. If the path is
// a simple file name, it is placed inside the data directory (or on the root
// pipe path on Windows), whereas if it's a resolvable path name (absolute or
...
...
@@ -389,10 +392,12 @@ func makeAccountManager(conf *Config) (*accounts.Manager, string, error) {
backends
:=
[]
accounts
.
Backend
{
keystore
.
NewKeyStore
(
keydir
,
scryptN
,
scryptP
),
}
if
ledgerhub
,
err
:=
usbwallet
.
NewLedgerHub
();
err
!=
nil
{
log
.
Warn
(
fmt
.
Sprintf
(
"Failed to start Ledger hub, disabling: %v"
,
err
))
}
else
{
backends
=
append
(
backends
,
ledgerhub
)
if
!
conf
.
NoUSB
{
if
ledgerhub
,
err
:=
usbwallet
.
NewLedgerHub
();
err
!=
nil
{
log
.
Warn
(
fmt
.
Sprintf
(
"Failed to start Ledger hub, disabling: %v"
,
err
))
}
else
{
backends
=
append
(
backends
,
ledgerhub
)
}
}
return
accounts
.
NewManager
(
backends
...
),
ephemeral
,
nil
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment