diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-06-04 23:43:43 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-06-24 16:32:19 -0400 |
commit | 46004790588c24174a0bec49b540d158ce163ffd (patch) | |
tree | 091d77316fac2460d14b81580c9ce387fd77f2ac /src/psbt.cpp | |
parent | 5279d8bc07d601fe6a67ad665fbc7591fe73c7de (diff) |
psbt: always put a non_witness_utxo and don't remove it
Offline signers will always need a non_witness_utxo so make sure it is
there.
Diffstat (limited to 'src/psbt.cpp')
-rw-r--r-- | src/psbt.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp index 71a3e06708..3fb743e5db 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -136,8 +136,8 @@ void PSBTInput::Merge(const PSBTInput& input) { if (!non_witness_utxo && input.non_witness_utxo) non_witness_utxo = input.non_witness_utxo; if (witness_utxo.IsNull() && !input.witness_utxo.IsNull()) { + // TODO: For segwit v1, we will want to clear out the non-witness utxo when setting a witness one. For v0 and non-segwit, this is not safe witness_utxo = input.witness_utxo; - non_witness_utxo = nullptr; // Clear out any non-witness utxo when we set a witness one. } partial_sigs.insert(input.partial_sigs.begin(), input.partial_sigs.end()); @@ -274,10 +274,11 @@ bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& if (require_witness_sig && !sigdata.witness) return false; input.FromSignatureData(sigdata); - // If we have a witness signature, use the smaller witness UTXO. + // If we have a witness signature, put a witness UTXO. + // TODO: For segwit v1, we should remove the non_witness_utxo if (sigdata.witness) { input.witness_utxo = utxo; - input.non_witness_utxo = nullptr; + // input.non_witness_utxo = nullptr; } // Fill in the missing info |