aboutsummaryrefslogtreecommitdiffstats
path: root/node
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
parent52bd4e29ff5c6a6f13ba163f24da96325f63683b (diff)
downloadgo-tangerine-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar
go-tangerine-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.gz
go-tangerine-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.bz2
go-tangerine-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.lz
go-tangerine-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.xz
go-tangerine-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.tar.zst
go-tangerine-ac2a0e615bd45eab81cd793cde5a4eef2a8581c8.zip
accounts/usbwallet: initial support for Ledger wallets
Diffstat (limited to 'node')
-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
}