Skip to content

psbt: compact witness utxo scripts after parsing#2563

Open
starius wants to merge 1 commit into
btcsuite:masterfrom
starius:psbt-oom
Open

psbt: compact witness utxo scripts after parsing#2563
starius wants to merge 1 commit into
btcsuite:masterfrom
starius:psbt-oom

Conversation

@starius

@starius starius commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

wire.ReadTxOut returns PkScript slices backed by its internal 4 MiB script slab. PSBT inputs keep parsed WitnessUtxo values, so small scripts could otherwise keep the whole slab live.

Copy the script before storing the TxOut and assert the parsed witness script has compact capacity.

Fix https://github.com/btcsuite/btcd/pull/2558/changes#r3510704991

wire.ReadTxOut returns PkScript slices backed by its internal 4 MiB
script slab. PSBT inputs keep parsed WitnessUtxo values, so small
scripts could otherwise keep the whole slab live.

Copy the script before storing the TxOut and assert the parsed witness
script has compact capacity.

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants