aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/psbtwallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/psbtwallet.cpp')
-rw-r--r--src/wallet/psbtwallet.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/psbtwallet.cpp b/src/wallet/psbtwallet.cpp
index 721a244afb..88740ef4a4 100644
--- a/src/wallet/psbtwallet.cpp
+++ b/src/wallet/psbtwallet.cpp
@@ -39,6 +39,13 @@ TransactionError FillPSBT(const CWallet* pwallet, PartiallySignedTransaction& ps
return TransactionError::SIGHASH_MISMATCH;
}
+ // Backport of #17156 fix, without #17371 refactor
+ if (input.witness_utxo.IsNull() && input.non_witness_utxo) {
+ if (txin.prevout.n >= input.non_witness_utxo->vout.size()) {
+ return TransactionError::MISSING_INPUTS;
+ }
+ }
+
complete &= SignPSBTInput(HidingSigningProvider(pwallet, !sign, !bip32derivs), psbtx, i, sighash_type);
}