psbt: add PSBTv2 global tx fields

When decomposing a transaction into a PSBTv2, the tx version and
locktime need to be stored in their respective global fields. Add those
fields and fill them when constructing.
This commit is contained in:
Ava Chow
2026-03-16 21:15:26 -07:00
parent c01c7f068c
commit 543d3e1cdc
2 changed files with 7 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ using common::PSBTError;
PartiallySignedTransaction::PartiallySignedTransaction(const CMutableTransaction& tx) : tx(tx)
{
tx_version = tx.version;
fallback_locktime = tx.nLockTime;
inputs.reserve(tx.vin.size());
for (const CTxIn& input : tx.vin) {
inputs.emplace_back(GetVersion(), input.prevout.hash, input.prevout.n, input.nSequence);