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,10 +133,19 @@ 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 {
if info.ProductID == id && info.Interface == 0 { // The HID interface number is not available on windows and OSX
devices = append(devices, info) if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
break 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" { if runtime.GOOS == "linux" {