aboutsummaryrefslogtreecommitdiff
path: root/src/psbt.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-06-04 23:43:43 -0400
committerfanquake <fanquake@gmail.com>2020-07-03 09:21:42 +0800
commit3228b59b1761a80bca6aa7309cb46db5acafc905 (patch)
tree8b92f26b142fbc3f9855fb1dfb431b2a230266f9 /src/psbt.h
parented5ec3080419445c0af7410c0af7a421704841a6 (diff)
downloadbitcoin-3228b59b1761a80bca6aa7309cb46db5acafc905.tar.xz
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. Github-Pull: #19215 Rebased-From: 46004790588c24174a0bec49b540d158ce163ffd
Diffstat (limited to 'src/psbt.h')
-rw-r--r--src/psbt.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/psbt.h b/src/psbt.h
index 1f7f84af6b..6eb411e3a4 100644
--- a/src/psbt.h
+++ b/src/psbt.h
@@ -63,12 +63,12 @@ struct PSBTInput
template <typename Stream>
inline void Serialize(Stream& s) const {
// Write the utxo
- // If there is a non-witness utxo, then don't add the witness one.
if (non_witness_utxo) {
SerializeToVector(s, PSBT_IN_NON_WITNESS_UTXO);
OverrideStream<Stream> os(&s, s.GetType(), s.GetVersion() | SERIALIZE_TRANSACTION_NO_WITNESS);
SerializeToVector(os, non_witness_utxo);
- } else if (!witness_utxo.IsNull()) {
+ }
+ if (!witness_utxo.IsNull()) {
SerializeToVector(s, PSBT_IN_WITNESS_UTXO);
SerializeToVector(s, witness_utxo);
}