minor hwi and mempool fetching tweaks

This commit is contained in:
Craig Raw 2020-07-27 08:15:15 +02:00
parent 1c03e1935e
commit 7428d21cac
3 changed files with 13 additions and 2 deletions

View file

@ -129,7 +129,6 @@ public class DevicePane extends TitledDescriptionPane {
private void createImportButton() {
importButton = new SplitMenuButton();
importButton.getStyleClass().add("default-button");
importButton.setAlignment(Pos.CENTER_RIGHT);
importButton.setText("Import Keystore");
importButton.setOnAction(event -> {
@ -279,6 +278,8 @@ public class DevicePane extends TitledDescriptionPane {
setError(sendPinService.getException().getMessage(), null);
enterPinButton.setDisable(false);
});
setDescription("Unlocking...");
showHideLink.setVisible(false);
sendPinService.start();
}
@ -354,6 +355,8 @@ public class DevicePane extends TitledDescriptionPane {
setError(getXpubService.getException().getMessage(), null);
importButton.setDisable(false);
});
setDescription("Importing...");
showHideLink.setVisible(false);
getXpubService.start();
}
@ -367,6 +370,8 @@ public class DevicePane extends TitledDescriptionPane {
setError(signPSBTService.getException().getMessage(), null);
signButton.setDisable(false);
});
setDescription("Signing...");
showHideLink.setVisible(false);
signPSBTService.start();
}

View file

@ -313,6 +313,10 @@ public class ElectrumServer {
}
}
if(blockHeights.isEmpty()) {
return Collections.emptyMap();
}
JsonRpcClient client = new JsonRpcClient(getTransport());
BatchRequestBuilder<Integer, String> batchRequest = client.createBatchRequest().keysType(Integer.class).returnType(String.class);
for(Integer height : blockHeights) {

View file

@ -103,8 +103,10 @@ public class Hwi {
JsonElement error = result.get("error");
if(error != null && error.getAsString().equals("sign_tx canceled")) {
throw new SignTransactionException("Signing cancelled");
} else if(error != null && error.getAsString().equals("open failed")) {
throw new SignTransactionException("Please reconnect your USB device");
} else if(error != null) {
throw new SignTransactionException("Error: " + error.getAsString());
throw new SignTransactionException(error.getAsString());
} else {
throw new SignTransactionException("Could not retrieve PSBT");
}