diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java b/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java index 342b6491..6d0ee1b2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java @@ -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(); } diff --git a/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java b/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java index c4e7a915..a2bdb612 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java @@ -313,6 +313,10 @@ public class ElectrumServer { } } + if(blockHeights.isEmpty()) { + return Collections.emptyMap(); + } + JsonRpcClient client = new JsonRpcClient(getTransport()); BatchRequestBuilder batchRequest = client.createBatchRequest().keysType(Integer.class).returnType(String.class); for(Integer height : blockHeights) { diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java index 741544f6..9635ae87 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java @@ -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"); }