From 26cd41f0c7a1d1e379f15117d3a62235f6c2d739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 9 Feb 2017 14:39:26 +0200 Subject: accounts/usbwallet: make wallet responsive while Ledger is busy --- cmd/geth/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmd/geth') 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() } } }() -- cgit v1.2.3