diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/rpcwallet.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 96e63dac23..b268e9a877 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4525,6 +4525,13 @@ bool FillPSBT(const CWallet* pwallet, PartiallySignedTransaction& psbtx, const C complete &= SignPSBTInput(PublicOnlySigningProvider(pwallet), *psbtx.tx, input, sigdata, i, sighash_type); } + if (sigdata.witness) { + // Convert the non-witness utxo to witness + if (input.witness_utxo.IsNull() && input.non_witness_utxo) { + input.witness_utxo = input.non_witness_utxo->vout[txin.prevout.n]; + } + } + // If both UTXO types are present, drop the unnecessary one. if (input.non_witness_utxo && !input.witness_utxo.IsNull()) { if (sigdata.witness) { |