aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/usbwallet/ledger_hub.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-01 23:45:17 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-08-09 16:30:17 +0800
commitdb568a61e2a98880ab308bf2224aa34073dc7f39 (patch)
tree97da46661ad3002b6ff9f6dca07e3105da5a9c5a /accounts/usbwallet/ledger_hub.go
parent17ce0a37de5a2712a8bf9d58df705e718b3b2cd6 (diff)
downloaddexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar.gz
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.tar.zst
dexon-db568a61e2a98880ab308bf2224aa34073dc7f39.zip
accounts, console, internal: support trezor hardware wallet
Diffstat (limited to 'accounts/usbwallet/ledger_hub.go')
-rw-r--r--accounts/usbwallet/ledger_hub.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/accounts/usbwallet/ledger_hub.go b/accounts/usbwallet/ledger_hub.go
index 2b0d56097..ffe7cffe4 100644
--- a/accounts/usbwallet/ledger_hub.go
+++ b/accounts/usbwallet/ledger_hub.go
@@ -14,10 +14,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
-// This file contains the implementation for interacting with the Ledger hardware
-// wallets. The wire protocol spec can be found in the Ledger Blue GitHub repo:
-// https://raw.githubusercontent.com/LedgerHQ/blue-app-eth/master/doc/ethapp.asc
-
package usbwallet
import (
@@ -140,14 +136,14 @@ func (hub *LedgerHub) refreshWallets() {
// Drop wallets in front of the next device or those that failed for some reason
for len(hub.wallets) > 0 && (hub.wallets[0].URL().Cmp(url) < 0 || hub.wallets[0].(*ledgerWallet).failed()) {
- events = append(events, accounts.WalletEvent{Wallet: hub.wallets[0], Arrive: false})
+ events = append(events, accounts.WalletEvent{Wallet: hub.wallets[0], Kind: accounts.WalletDropped})
hub.wallets = hub.wallets[1:]
}
// If there are no more wallets or the device is before the next, wrap new wallet
if len(hub.wallets) == 0 || hub.wallets[0].URL().Cmp(url) > 0 {
wallet := &ledgerWallet{hub: hub, url: &url, info: ledger, log: log.New("url", url)}
- events = append(events, accounts.WalletEvent{Wallet: wallet, Arrive: true})
+ events = append(events, accounts.WalletEvent{Wallet: wallet, Kind: accounts.WalletArrived})
wallets = append(wallets, wallet)
continue
}
@@ -160,7 +156,7 @@ func (hub *LedgerHub) refreshWallets() {
}
// Drop any leftover wallets and set the new batch
for _, wallet := range hub.wallets {
- events = append(events, accounts.WalletEvent{Wallet: wallet, Arrive: false})
+ events = append(events, accounts.WalletEvent{Wallet: wallet, Kind: accounts.WalletDropped})
}
hub.refreshed = time.Now()
hub.wallets = wallets