show error when importing tpubs from usb on mainnet etc
@@ -442,6 +442,7 @@ public class DevicePane extends TitledDescriptionPane {
getXpubService.setOnSucceeded(workerStateEvent -> {
String xpub = getXpubService.getValue();
+ try {
Keystore keystore = new Keystore();
keystore.setLabel(device.getModel().toDisplayString());
keystore.setSource(KeystoreSource.HW_USB);
@@ -450,6 +451,9 @@ public class DevicePane extends TitledDescriptionPane {
keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(xpub));
EventManager.get().post(new KeystoreImportEvent(keystore));
+ } catch(Exception e) {
+ setError("Could not retrieve xpub", e.getMessage());
+ }
});
getXpubService.setOnFailed(workerStateEvent -> {
setError("Could not retrieve xpub", getXpubService.getException().getMessage());
