mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
remove unused --addr_type parameter when using hwi displayaddress with --desc
This commit is contained in:
parent
f2c2fc6071
commit
4b3de044c3
1 changed files with 3 additions and 10 deletions
|
@ -106,22 +106,15 @@ public class Hwi {
|
||||||
throw new IllegalArgumentException("Cannot display address for script type " + scriptType + ": Only single hash types supported");
|
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");
|
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;
|
isPromptActive = false;
|
||||||
String output;
|
String output;
|
||||||
if(passphrase != null && !passphrase.isEmpty() && device.getModel().externalPassphraseEntry()) {
|
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 {
|
} 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();
|
JsonObject result = JsonParser.parseString(output).getAsJsonObject();
|
||||||
|
|
Loading…
Reference in a new issue