accounts/usbwallet: Fix Ledger nano S not working on OSX and Windows

This commit is contained in:
mexskican 2017-09-27 22:14:30 -07:00
parent a660685746
commit 307a5e610c

View file

@ -133,11 +133,20 @@ func (hub *Hub) refreshWallets() {
} }
for _, info := range hid.Enumerate(hub.vendorID, 0) { for _, info := range hid.Enumerate(hub.vendorID, 0) {
for _, id := range hub.productIDs { for _, id := range hub.productIDs {
// 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 { if info.ProductID == id && info.Interface == 0 {
devices = append(devices, info) devices = append(devices, info)
break break
} }
} }
}
} }
if runtime.GOOS == "linux" { if runtime.GOOS == "linux" {
// See rationale before the enumeration why this is needed and only on Linux. // See rationale before the enumeration why this is needed and only on Linux.