diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-01-23 15:58:05 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-13 20:00:04 +0800 |
commit | ac2a0e615bd45eab81cd793cde5a4eef2a8581c8 (patch) | |
tree | 9d6d14e438e65c1bded07473fa1c33250f44f4bd /node | |
parent | 52bd4e29ff5c6a6f13ba163f24da96325f63683b (diff) | |
download | dexon-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.gz dexon-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.zst dexon-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.zip |
accounts/usbwallet: initial support for Ledger wallets
Diffstat (limited to 'node')
-rw-r--r-- | node/config.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/node/config.go b/node/config.go index f3b4dcc73..9ae9406a9 100644 --- a/node/config.go +++ b/node/config.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/accounts/usbwallet" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/logger" @@ -432,6 +433,15 @@ func makeAccountManager(conf *Config) (am *accounts.Manager, ephemeralKeystore s if err := os.MkdirAll(keydir, 0700); err != nil { return nil, "", err } - ks := keystore.NewKeyStore(keydir, scryptN, scryptP) - return accounts.NewManager(ks), ephemeralKeystore, nil + + // Assemble the account manager and supported backends + backends := []accounts.Backend{ + keystore.NewKeyStore(keydir, scryptN, scryptP), + } + if ledgerhub, err := usbwallet.NewLedgerHub(); err != nil { + glog.V(logger.Warn).Infof("Failed to start Ledger hub, disabling: %v", err) + } else { + backends = append(backends, ledgerhub) + } + return accounts.NewManager(backends...), ephemeralKeystore, nil } |