AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 48 Bitcoin

Merge PR 'Release wallet UTXOs when FundingBuilder rejects a coin selection' (#5634)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Release wallet UTXOs when FundingBuilder rejects a coin selection' (#5634)

from bot/5624-fundingbuilder-leaks-utxo-locks-419042 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5634
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change fixes a wallet bug in rust-lightning where a UTXO could be selected for a Lightning funding transaction, then rejected because its previous transaction was too large to fit in a Lightning peer message. Previously, that rejection could leave the UTXO locked or unavailable. The fix adds a size check during coin selection so oversized UTXOs are skipped before being selected, keeping them available for other uses. It also updates the public wallet API with a new parameter for this size limit.

Recommended action

Review downstream wallet implementations of CoinSelectionSource/CoinSelectionSourceSync to ensure they accept and honor the new max_input_prevtx_serialized_len parameter, especially custom wallets that may not inherit WalletSync's filtering. Monitor for any remaining paths where a selected UTXO can be rejected after selection without explicit lock release.

Security signals we found

01

API change to CoinSelectionSource::select_confirmed_utxos adding max_input_prevtx_serialized_len

02

WalletSync filters UTXOs by prevtx serialized length before selection

03

FundingBuilder enforces Lightning tx_add_input message-size limit at selection time

04

New regression test verifies oversized-prevtx UTXO remains available after coin-selection failure

05

Existing test renamed/updated from PrevTxTooLarge to CoinSelectionFailed path

06

Changelog frames this as an API update and UTXO-lock leak fix

Risk score

Why this scored 48/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 7/15
Affected reach 10/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.