Use GetUnsignedTx when serializing in PSBTv0

If we are asked to make a PSBTv0, we may not necessarily have made an
unsigned transaction. So instead use GetUnsignedTx which will either
fetch one that already exists, or construct a new one from the stored
data. Internally we may be storing a PSBTv0 like a PSBTv2, but still
want to serialize those as v0.
This commit is contained in:
Ava Chow 2024-07-22 17:14:51 -04:00
parent 2bcb9d07b2
commit 00a49ca94e

View file

@ -1345,7 +1345,7 @@ struct PartiallySignedTransaction
SerializeToVector(s, CompactSizeWriter(PSBT_GLOBAL_UNSIGNED_TX));
// Write serialized tx to a stream
SerializeToVector(s, TX_NO_WITNESS(*tx));
SerializeToVector(s, TX_NO_WITNESS(GetUnsignedTx()));
}
// Write xpubs