From fdc31b871959b91f03bbbd5a1ae383969049d597 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 9 Apr 2020 15:08:06 +0200 Subject: [PATCH] minor refactoring --- drongo | 2 +- .../sparrow/transaction/InputController.java | 18 ++++-------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drongo b/drongo index c8226ea9..2f565570 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit c8226ea947d910186d3a2e37ba9c5e85c2ec09ef +Subproject commit 2f5655708df1b7722dfb4098cd9c79aad1a35886 diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java index 528f4e29..b18b37f6 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java @@ -185,22 +185,12 @@ public class InputController extends TransactionFormController implements Initia Script witnessScript = null; if(txInput.hasWitness()) { - List witnessChunks = txInput.getWitness().asScriptChunks(); - if(witnessChunks.get(witnessChunks.size() - 1).isScript()) { - witnesses = new Script(witnessChunks.subList(0, witnessChunks.size() - 1)); - witnessScript = witnessChunks.get(witnessChunks.size() - 1).getScript(); - } else { - witnesses = new Script(witnessChunks); - } + witnesses = new Script(txInput.getWitness().asScriptChunks()); + witnessScript = txInput.getWitness().getWitnessScript(); } else if(psbtInput != null) { if(psbtInput.getFinalScriptWitness() != null) { - List witnessChunks = psbtInput.getFinalScriptWitness().asScriptChunks(); - if(witnessChunks.get(witnessChunks.size() - 1).isScript()) { - witnesses = new Script(witnessChunks.subList(0, witnessChunks.size() - 1)); - witnessScript = witnessChunks.get(witnessChunks.size() - 1).getScript(); - } else { - witnesses = new Script(witnessChunks); - } + witnesses = new Script(psbtInput.getFinalScriptWitness().asScriptChunks()); + witnessScript = psbtInput.getFinalScriptWitness().getWitnessScript(); } else if(psbtInput.getWitnessScript() != null) { witnessScript = psbtInput.getWitnessScript(); }