diff options
author | Guillaume Ballet <gballet@gmail.com> | 2019-05-31 17:30:28 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-05-31 17:30:28 +0800 |
commit | 7a22da98b9f81d206eb65d1fa4f5e773d888bac3 (patch) | |
tree | 3a28f61d12c7b43e5ab4a5b5c7ed2c9e8cbf8a94 /node | |
parent | 30263ad37d49c014512a9a7d8abdd17f305843e9 (diff) | |
download | go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.gz go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.bz2 go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.lz go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.xz go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.zst go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.zip |
accounts/scwallet: flag to specify path to smartcard daemon (#19439)
* accounts/scwallet: Add a switch to enable smartcard support
* accounts: change the meaning of the switch
* disable card support in windows until tested
* only activate account if pcscd socket file is present
* the switch is now the path to the socket file
* accounts/scwallet: holiman's review feedback
* accounts/scwallet: send the path to go-pcsclite
* accounts/scwallet: add default, per platform path
* accounts/scwallet: fix error log warning
* accounts/scwallet: update pcsc lib to latest
* accounts/scwallet: use default path from pcsclite
* scwallet: forgot to change switch name
* cmd: minor style cleanups (error handling first, then happy path)
Diffstat (limited to 'node')
-rw-r--r-- | node/config.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/node/config.go b/node/config.go index 43ee5ec21..d76311ba6 100644 --- a/node/config.go +++ b/node/config.go @@ -95,6 +95,9 @@ type Config struct { // NoUSB disables hardware wallet monitoring and connectivity. NoUSB bool `toml:",omitempty"` + // SmartCardDaemonPath is the path to the smartcard daemon's socket + SmartCardDaemonPath string `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 @@ -505,11 +508,13 @@ func makeAccountManager(conf *Config) (*accounts.Manager, string, error) { backends = append(backends, trezorhub) } } - // Start a smart card hub - if schub, err := scwallet.NewHub(scwallet.Scheme, keydir); err != nil { - log.Warn(fmt.Sprintf("Failed to start smart card hub, disabling: %v", err)) - } else { - backends = append(backends, schub) + if len(conf.SmartCardDaemonPath) > 0 { + // Start a smart card hub + if schub, err := scwallet.NewHub(conf.SmartCardDaemonPath, scwallet.Scheme, keydir); err != nil { + log.Warn(fmt.Sprintf("Failed to start smart card hub, disabling: %v", err)) + } else { + backends = append(backends, schub) + } } } |