aboutsummaryrefslogtreecommitdiffstats
path: root/node/config.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-01-23 15:58:05 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-13 20:00:04 +0800
commitac2a0e615bd45eab81cd793cde5a4eef2a8581c8 (patch)
tree9d6d14e438e65c1bded07473fa1c33250f44f4bd /node/config.go
parent52bd4e29ff5c6a6f13ba163f24da96325f63683b (diff)
downloaddexon-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.gz
dexon-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.zst
dexon-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.zip
accounts/usbwallet: initial support for Ledger wallets
Diffstat (limited to 'node/config.go')
-rw-r--r--node/config.go14
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
}