feat: prevent Liquid send crash on >256 UTXOs via self-transfer consolidation - #2465
Merged
Conversation
wired-pasteque
force-pushed
the
fix/liquid-wallet-utxo-limit
branch
from
July 22, 2026 05:12
75f4296 to
a77c012
Compare
…native consolidate
wired-pasteque
force-pushed
the
fix/liquid-wallet-utxo-limit
branch
from
July 22, 2026 05:20
a77c012 to
99395b4
Compare
wired-pasteque
marked this pull request as ready for review
July 22, 2026 11:45
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the crash when spending from a Liquid wallet holding more than ~256 UTXOs (the confidential-transaction input limit), and adds a guided consolidation flow so the wallet never gets there in the first place.
How it works
LwkWalletDatasource.buildPsetnowproactively/reactively detects when a wallet's confirmed L-BTC UTXO count
exceeds the limit and throws
ConsolidationRequiredExceptioninstead ofletting the native call crash the app.
CheckLiquidConsolidationUsecasereads the wallet'sL-BTC UTXO count and compares it against a threshold set safely below
the hard limit (250), so the user is warned well before a real spend
would ever fail.
consolidationfeature lets the user sweeptheir UTXOs into a single self-transfer output (or a few, if the count
is large enough to need batching)
ConsolidationRequiredCardbanner surfaceson the wallet home/detail screens, and inline on the send and swap
screens, whenever a wallet crosses the threshold — routing to the new
consolidation screen.
Also fixed along the way
broadcasting several batches, the already-succeeded batches' txids are
now tracked (
ConsolidationException.succeededTxids) instead ofdiscarded, and the cached preview is cleared on failure so a retry always
rebuilds fresh PSETs rather than resubmitting an already-broadcast (and
so already-spent) batch.
run the build→sign→broadcast pipeline twice concurrently.
broadcast step used to swallow failures with no trace; both now log the
cause via the app's logger.
Tested using small amounts of UTXOs.
Screen.Recording.2026-07-22.at.12.38.06.AM.mov