mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
cleanup psbt utxo fetching
This commit is contained in:
parent
279b0e0ac1
commit
33d6da8a99
3 changed files with 8 additions and 18 deletions
2
drongo
2
drongo
|
@ -1 +1 @@
|
|||
Subproject commit af562dad1022c24d5ff851100cc3958a852fbec8
|
||||
Subproject commit 8bc4e3b3dcf4c826d148aeafd556ecdbe8673939
|
|
@ -156,13 +156,7 @@ public class InputController extends TransactionFormController implements Initia
|
|||
|
||||
from.setVisible(false);
|
||||
if(psbtInput != null) {
|
||||
TransactionOutput output = null;
|
||||
if(psbtInput.getNonWitnessUtxo() != null) {
|
||||
output = psbtInput.getNonWitnessUtxo().getOutputs().get(txInput.getIndex());
|
||||
} else if(psbtInput.getWitnessUtxo() != null) {
|
||||
output = psbtInput.getWitnessUtxo();
|
||||
}
|
||||
|
||||
TransactionOutput output = psbtInput.getUtxo();
|
||||
updateSpends(output);
|
||||
} else if(inputForm.getInputTransactions() != null) {
|
||||
updateSpends(inputForm.getInputTransactions());
|
||||
|
@ -299,7 +293,7 @@ public class InputController extends TransactionFormController implements Initia
|
|||
PSBTInput psbtInput = inputForm.getPsbtInput();
|
||||
|
||||
int reqSigs = -1;
|
||||
if((psbtInput.getNonWitnessUtxo() != null || psbtInput.getWitnessUtxo() != null) && psbtInput.getSigningScript() != null) {
|
||||
if(psbtInput.getUtxo() != null && psbtInput.getSigningScript() != null) {
|
||||
try {
|
||||
reqSigs = psbtInput.getSigningScript().getNumRequiredSignatures();
|
||||
} catch (NonStandardScriptException e) {
|
||||
|
|
|
@ -56,17 +56,13 @@ public class InputsController extends TransactionFormController implements Initi
|
|||
boolean showDenominator = true;
|
||||
|
||||
List<TransactionOutput> outputs = new ArrayList<>();
|
||||
for(int i = 0; i < tx.getInputs().size(); i++) {
|
||||
TransactionInput input = tx.getInputs().get(i);
|
||||
PSBTInput psbtInput = inputsForm.getPsbt().getPsbtInputs().get(i);
|
||||
|
||||
if(psbtInput.getNonWitnessUtxo() != null) {
|
||||
outputs.add(psbtInput.getNonWitnessUtxo().getOutputs().get((int)input.getOutpoint().getIndex()));
|
||||
} else if(psbtInput.getWitnessUtxo() != null) {
|
||||
outputs.add(psbtInput.getWitnessUtxo());
|
||||
for(PSBTInput psbtInput : inputsForm.getPsbt().getPsbtInputs()) {
|
||||
TransactionOutput output = psbtInput.getUtxo();
|
||||
if(output != null) {
|
||||
outputs.add(output);
|
||||
}
|
||||
|
||||
if((psbtInput.getNonWitnessUtxo() != null || psbtInput.getWitnessUtxo() != null) && psbtInput.getSigningScript() != null) {
|
||||
if(psbtInput.getUtxo() != null && psbtInput.getSigningScript() != null) {
|
||||
try {
|
||||
reqSigs += psbtInput.getSigningScript().getNumRequiredSignatures();
|
||||
} catch (NonStandardScriptException e) {
|
||||
|
|
Loading…
Reference in a new issue