Repository navigation
Record what a changeless withdrawal really sends, so the interceptor decides on it - #681
Merged
Merged
Conversation
…s, not the declared one
Jossec101
approved these changes
Nov 23, 2026
Jossec101
enabled auto-merge (squash)
November 23, 2026 16:01
Jossec101
disabled auto-merge
November 23, 2026 16:03
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.
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.