From 307a5e610cc913f80cb63b2e5515d22b8ac5a1fb Mon Sep 17 00:00:00 2001 From: mexskican Date: Wed, 27 Sep 2017 22:14:30 -0700 Subject: [PATCH] accounts/usbwallet: Fix Ledger nano S not working on OSX and Windows --- accounts/usbwallet/hub.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 7069d25311..d5f6003417 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -133,10 +133,19 @@ func (hub *Hub) refreshWallets() { } for _, info := range hid.Enumerate(hub.vendorID, 0) { for _, id := range hub.productIDs { - if info.ProductID == id && info.Interface == 0 { - devices = append(devices, info) - break + // The HID interface number is not available on windows and OSX + if runtime.GOOS == "darwin" || runtime.GOOS == "windows" { + if info.ProductID == id && info.Interface == -1 { + devices = append(devices, info) + break + } + } else { + if info.ProductID == id && info.Interface == 0 { + devices = append(devices, info) + break + } } + } } if runtime.GOOS == "linux" {