Repository navigation
fix(bitcoin): align onAmountInput with getMaxSendableAmount - #645
Open
ulissesferreira wants to merge 1 commit into
Open
ulissesferreira wants to merge 1 commit into
ulissesferreira wants to merge 1 commit into
Conversation
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-align-on-amount-input-with-max
branch
2 times, most recently
from
November 17, 2026 16:04
1075f05 to
c3b84ca
Compare
ulissesferreira
marked this pull request as ready for review
November 17, 2026 16:09
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-align-on-amount-input-with-max
branch
from
November 17, 2026 16:25
c3b84ca to
93eb8e0
Compare
|
This branch has not been deployed
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.



Explanation
onAmountInputandgetMaxSendableAmountdisagreed on the full spendable balance. The max probe never drains the wallet, whileonAmountInputdrained whenever the entered amount equaled the balance, so the reported max was smaller than an inputonAmountInputwould still accept.This PR makes both paths share one probe (
RpcHandler.#probeAmount) and makes the probe always add the amount as a recipient, even when it equals the balance.onAmountInputnow rejects the full balance withInsufficientBalanceToCoverFeeunless the entered amount also covers the fee, exactly asgetMaxSendableAmountdoes. Actual sends still drain when the amount equals the balance, and the internal send form's SetMax behavior is unchanged.References
Ticket: WPN-2442
Stacked on: #587
Checklist