Skip to content

Record what a changeless withdrawal really sends, so the interceptor decides on it - #681

Merged
Jossec101 merged 1 commit into
mainfrom
fix/changeless-withdrawal-amount
Nov 23, 2026
Merged

Jossec101 merged 1 commit into
mainfrom
fix/changeless-withdrawal-amount

Conversation

@markettes

Copy link
Copy Markdown
Contributor

A changeless withdrawal sends the selected UTXOs in full to its single destination, minus the fee; the amount in the request plays no part in building the transaction. The UI sets that amount to the total of the UTXOs, but RequestWithdrawal over gRPC stored whatever amount_sats the caller sent. On regtest, a request declaring 1,000 sats over a 20 BTC UTXO was put to the withdrawal interceptor as 1,000 sats, allowed, and paid 1,999,999,780 sats.

RequestWithdrawal now stores the total of the named UTXOs as the amount, so the audit, the wallet events and the interceptor see what leaves the wallet. A changeless request needs at least one outpoint, and every outpoint has to be a confirmed UTXO of the wallet. GenerateTemplatePSBT refuses a changeless request whose amount differs from its inputs, whichever path created it. An RBF bump of a changeless request takes its amount from the locked UTXOs, so older requests stored with the declared amount can still be bumped.

The recorded amount is gross: the fee comes out of it. amount_sats is ignored for changeless requests and no longer has to be positive.

@Jossec101
Jossec101 enabled auto-merge (squash) November 23, 2026 16:01
@Jossec101
Jossec101 disabled auto-merge November 23, 2026 16:03
@Jossec101
Jossec101 merged commit 9e018d1 into main Nov 23, 2026
11 checks passed
@Jossec101
Jossec101 deleted the fix/changeless-withdrawal-amount branch November 23, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants