aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-09 20:39:26 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-13 20:00:10 +0800
commit26cd41f0c7a1d1e379f15117d3a62235f6c2d739 (patch)
tree12baed4158fcf44753c9c3ea83785b55877dd29f /cmd
parentfb1984685562479bfe2b041ae98f901525d1d9d3 (diff)
downloaddexon-26cd41f0c7a1d1e379f15117d3a62235f6c2d739.tar
dexon-26cd41f0c7a1d1e379f15117d3a62235f6c2d739.tar.gz
dexon-26cd41f0c7a1d1e379f15117d3a62235f6c2d739.tar.bz2
dexon-26cd41f0c7a1d1e379f15117d3a62235f6c2d739.tar.lz
dexon-26cd41f0c7a1d1e379f15117d3a62235f6c2d739.tar.xz
dexon-26cd41f0c7a1d1e379f15117d3a62235f6c2d739.tar.zst
dexon-26cd41f0c7a1d1e379f15117d3a62235f6c2d739.zip
accounts/usbwallet: make wallet responsive while Ledger is busy
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 06dc55ba8..cc597717e 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -269,6 +269,13 @@ func startNode(ctx *cli.Context, stack *node.Node) {
}
stateReader := ethclient.NewClient(rpcClient)
+ // Open and self derive any wallets already attached
+ for _, wallet := range stack.AccountManager().Wallets() {
+ if err := wallet.Open(""); err != nil {
+ glog.V(logger.Warn).Infof("Failed to open wallet %s: %v", wallet.URL(), err)
+ }
+ wallet.SelfDerive(accounts.DefaultBaseDerivationPath, stateReader)
+ }
// Listen for wallet event till termination
for event := range events {
if event.Arrive {
@@ -280,6 +287,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
event.Wallet.SelfDerive(accounts.DefaultBaseDerivationPath, stateReader)
} else {
glog.V(logger.Info).Infof("Old wallet dropped: %s", event.Wallet.URL())
+ event.Wallet.Close()
}
}
}()