mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #14197: [psbt] Convert non-witness UTXOs to witness if witness sig created
862d159d63Add test for conversion from non-witness to witness UTXO (Pieter Wuille)f8c1714634Convert non-witness UTXOs to witness if witness sig created (Andrew Chow) Pull request description: If a witness signature was created when a non-witness UTXO is used, convert the non-witness UTXO to a witness one. Port of #14196 to master. Tree-SHA512: 2235eeb008ffa48e821628032d689e4a83bff6c29b93fa050ab2ee492b0e67b3a30f29a680d4a0e574e05c3a2f9edf0005e161fbe25b7aef2acd034a2424e2f2
This commit is contained in:
@@ -280,6 +280,11 @@ bool SignPSBTInput(const SigningProvider& provider, const CMutableTransaction& t
|
||||
if (require_witness_sig && !sigdata.witness) return false;
|
||||
input.FromSignatureData(sigdata);
|
||||
|
||||
if (sigdata.witness) {
|
||||
assert(!utxo.IsNull());
|
||||
input.witness_utxo = utxo;
|
||||
}
|
||||
|
||||
// If both UTXO types are present, drop the unnecessary one.
|
||||
if (input.non_witness_utxo && !input.witness_utxo.IsNull()) {
|
||||
if (sigdata.witness) {
|
||||
|
||||
Reference in New Issue
Block a user