fix(wallet): send amount_msat when paying an amountless invoice #162
No reviewers
Labels
No labels
app:activities
app:chat
app:chatelet
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp!162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/wallet-amountless-invoice"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Paying a zero-amount BOLT11 always failed. The send dialog correctly showed an amount field for such an invoice, but the amount the user typed was then dropped: the request body carried only
bolt11.LNbits rejects that outright.
_validate_payment_requestraises "Amount required for amountless invoices." when the invoice has no amount and noamount_msataccompanies it. So the user filled in an amount and got an error back.Approach
The invoice is decoded in the service rather than trusted from the caller, so every caller benefits and no call site has to remember the rule.
light-bolt11-decoderwas already a dependency.amount_msat.Verification
Ran the helper against real inputs:
If the funding source has no amountless support, LNbits returns "Amountless invoices not supported by the funding source." and that message surfaces to the user, which is the right outcome.
vue-tsc --noEmitis clean.