Summary
Add an optional prev_txs parameter to utxoupdatepsbt, allowing callers
to provide raw parent transactions whose outputs are not yet in the UTXO set,
txindex, or mempool.
Motivation
When constructing presigned transaction chains (e.g. a Lightning commitment
transaction at zero fee paired with an anchor spend), the child PSBT cannot
be populated because the parent has not been broadcast yet. The existing
signrawtransactionwithwallet supports this via its prevtxs parameter,
but no equivalent exists in the PSBT workflow. Users are forced to either
fall back to legacy raw transaction signing or manually edit the PSBT binary
with external tools.
This closes the gap so that utxoupdatepsbt can handle the same use case
natively, which is increasingly relevant with submitpackage and TRUC/anchor
adoption.
Changes
- Add
ParsePrevTxs()helper to decode an array of raw transaction hex into a txid-indexed map - Extend
ProcessPSBT()to accept caller-provided transactions and check them before falling through to txindex/mempool/UTXO set lookup - Register the new
prev_txsarray parameter onutxoupdatepsbt - Add functional test covering the happy path, named parameter form, and invalid hex error handling
refs #30873
Test plan
-
test/functional/rpc_psbt.pypasses, including newtest_utxoupdatepsbt_prev_txscovering:- Input NOT populated when parent is unavailable
- Input populated correctly via
prev_txs - Correct txid in the resulting
non_witness_utxo - Error on invalid hex
- Named parameter form works