From 4b3de044c3a3944e3a8f8d3712fc037827b88945 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 11 Mar 2021 10:36:44 +0200 Subject: [PATCH] remove unused --addr_type parameter when using hwi displayaddress with --desc --- src/main/java/com/sparrowwallet/sparrow/io/Hwi.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java index 598a3e24..fa2417d1 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java @@ -106,22 +106,15 @@ public class Hwi { throw new IllegalArgumentException("Cannot display address for script type " + scriptType + ": Only single hash types supported"); } + //Remove replace once HWI-2.0.0 is released - see https://github.com/bitcoin-core/HWI/pull/488 String descriptor = outputDescriptor.toString().replace("sortedmulti", "multi"); - System.out.println(descriptor); - - String addrType = "legacy"; - if(scriptType == ScriptType.P2SH_P2WPKH) { - addrType = "sh_wit"; - } else if(scriptType == ScriptType.P2WPKH) { - addrType = "wit"; - } isPromptActive = false; String output; if(passphrase != null && !passphrase.isEmpty() && device.getModel().externalPassphraseEntry()) { - output = execute(getDeviceCommand(device, passphrase, Command.DISPLAY_ADDRESS, "--desc", descriptor, "--addr-type", addrType)); + output = execute(getDeviceCommand(device, passphrase, Command.DISPLAY_ADDRESS, "--desc", descriptor)); } else { - output = execute(getDeviceCommand(device, Command.DISPLAY_ADDRESS, "--desc", descriptor, "--addr-type", addrType)); + output = execute(getDeviceCommand(device, Command.DISPLAY_ADDRESS, "--desc", descriptor)); } JsonObject result = JsonParser.parseString(output).getAsJsonObject();