psbt: Use PSBTInput and PSBTOutput fields instead of accessing global tx

PSBTInput now has the previous txid and output index, and PSBTOutput has
the amount and script. We no longer need to access the global unsigned
tx for these fields.

Additionally, we can change iterating tx.vin and tx.vout to psbtx.inputs
and psbtx.outputs.

This is in prepration for use with PSBTv2 where the global unsigned tx
will not exist.
This commit is contained in:
Ava Chow
2026-03-16 15:44:43 -07:00
parent 95897507e9
commit 82c9fe3179
8 changed files with 41 additions and 49 deletions

View File

@@ -68,7 +68,7 @@ FUZZ_TARGET(psbt)
(void)output.IsNull();
}
for (size_t i = 0; i < psbt.tx->vin.size(); ++i) {
for (size_t i = 0; i < psbt.inputs.size(); ++i) {
CTxOut tx_out;
if (psbt.GetInputUTXO(tx_out, i)) {
(void)tx_out.IsNull();