Convert non-witness UTXOs to witness if witness sig created
If a witness signature was created when a non-witness UTXO is used, convert the non-witness UTXO to a witness one.
This commit is contained in:
parent
2796c6e5ec
commit
f8c1714634
1 changed files with 5 additions and 0 deletions
|
@ -277,6 +277,11 @@ bool SignPSBTInput(const SigningProvider& provider, const CMutableTransaction& t
|
||||||
if (require_witness_sig && !sigdata.witness) return false;
|
if (require_witness_sig && !sigdata.witness) return false;
|
||||||
input.FromSignatureData(sigdata);
|
input.FromSignatureData(sigdata);
|
||||||
|
|
||||||
|
if (sigdata.witness) {
|
||||||
|
assert(!utxo.IsNull());
|
||||||
|
input.witness_utxo = utxo;
|
||||||
|
}
|
||||||
|
|
||||||
// If both UTXO types are present, drop the unnecessary one.
|
// If both UTXO types are present, drop the unnecessary one.
|
||||||
if (input.non_witness_utxo && !input.witness_utxo.IsNull()) {
|
if (input.non_witness_utxo && !input.witness_utxo.IsNull()) {
|
||||||
if (sigdata.witness) {
|
if (sigdata.witness) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue