aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-11-01 16:08:17 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-11-01 16:09:38 +0100
commitf6df989842a1dee7e8ad779531c328456c7148a0 (patch)
tree41e95597fbf6f17e115df7ab5a155e1233b6010d /src/script
parent9899e65d84e72e638be856d5ee7b62daa4488c6d (diff)
parent862d159d635c1de219d94e030b186a745fe28eb9 (diff)
Merge #14197: [psbt] Convert non-witness UTXOs to witness if witness sig created
862d159d635c1de219d94e030b186a745fe28eb9 Add test for conversion from non-witness to witness UTXO (Pieter Wuille) f8c1714634445542a16ac01d128d8ad2b2810e19 Convert 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
Diffstat (limited to 'src/script')
-rw-r--r--src/script/sign.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index c721b20ced..89cc7c808c 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -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) {