mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
show error when importing tpubs from usb on mainnet etc
This commit is contained in:
parent
836bd6bc40
commit
5478ac05b8
1 changed files with 11 additions and 7 deletions
|
@ -442,14 +442,18 @@ public class DevicePane extends TitledDescriptionPane {
|
||||||
getXpubService.setOnSucceeded(workerStateEvent -> {
|
getXpubService.setOnSucceeded(workerStateEvent -> {
|
||||||
String xpub = getXpubService.getValue();
|
String xpub = getXpubService.getValue();
|
||||||
|
|
||||||
Keystore keystore = new Keystore();
|
try {
|
||||||
keystore.setLabel(device.getModel().toDisplayString());
|
Keystore keystore = new Keystore();
|
||||||
keystore.setSource(KeystoreSource.HW_USB);
|
keystore.setLabel(device.getModel().toDisplayString());
|
||||||
keystore.setWalletModel(device.getModel());
|
keystore.setSource(KeystoreSource.HW_USB);
|
||||||
keystore.setKeyDerivation(new KeyDerivation(device.getFingerprint(), derivationPath));
|
keystore.setWalletModel(device.getModel());
|
||||||
keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(xpub));
|
keystore.setKeyDerivation(new KeyDerivation(device.getFingerprint(), derivationPath));
|
||||||
|
keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(xpub));
|
||||||
|
|
||||||
EventManager.get().post(new KeystoreImportEvent(keystore));
|
EventManager.get().post(new KeystoreImportEvent(keystore));
|
||||||
|
} catch(Exception e) {
|
||||||
|
setError("Could not retrieve xpub", e.getMessage());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
getXpubService.setOnFailed(workerStateEvent -> {
|
getXpubService.setOnFailed(workerStateEvent -> {
|
||||||
setError("Could not retrieve xpub", getXpubService.getException().getMessage());
|
setError("Could not retrieve xpub", getXpubService.getException().getMessage());
|
||||||
|
|
Loading…
Reference in a new issue