aboutsummaryrefslogtreecommitdiffstats
path: root/node
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-04-20 19:01:51 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-04-20 19:01:51 +0800
commit6430e672c99f6d22582b104f8467d4bd8a4b5f6e (patch)
treef320b92a44384fdcc699e925197228f4a4f4ec0d /node
parente353f9c0886f0cc13fd01c8b3abf2fa63025c62f (diff)
downloaddexon-6430e672c99f6d22582b104f8467d4bd8a4b5f6e.tar
dexon-6430e672c99f6d22582b104f8467d4bd8a4b5f6e.tar.gz
dexon-6430e672c99f6d22582b104f8467d4bd8a4b5f6e.tar.bz2
dexon-6430e672c99f6d22582b104f8467d4bd8a4b5f6e.tar.lz
dexon-6430e672c99f6d22582b104f8467d4bd8a4b5f6e.tar.xz
dexon-6430e672c99f6d22582b104f8467d4bd8a4b5f6e.tar.zst
dexon-6430e672c99f6d22582b104f8467d4bd8a4b5f6e.zip
cmd, node: add --nosub and node.Config.NoUSB to disable hw wallets
Diffstat (limited to 'node')
-rw-r--r--node/config.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/node/config.go b/node/config.go
index 1bab4c574..61e0008ef 100644
--- a/node/config.go
+++ b/node/config.go
@@ -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
}