Skip to content

MAX on USD wallet → LNURL destination fills an amount that dead-ends at confirm when the real fee > 0 #692

Closed

Description

@islandbitcoin

Found during the #689 review. The USD wallet has no fee probe for LNURL destinations before an invoice exists, so MAX deliberately falls back to filling the full balance (documented in buildMaxAmountButton). Whenever the real fee is > 0, that amount then fails at confirm with the amount-exceeds-balance error — the same wall a user hits typing their full balance manually, but the MAX chip now actively invites it.

Options, roughly in order of preference:

  1. Request a throwaway invoice at the cap-clamped balance during the MAX computation and run the normal fee probe against it (cost: one extra invoice round-trip on tap).
  2. Reserve a conservative fee heuristic (e.g. the wallet's recent LNURL fee p95) and state it in the note.
  3. Accept the dead-end but catch the confirm-time error and offer a one-tap "retry with fee deducted".

Related: #690 (displayed vs spendable balance), #689 (MAX button), flash#480 (fractional balance serving).

🤖 Generated with Claude Code

https://claude.ai/code/session_015fAxSGEsL2LsMx1uCjAzHH

Activity

  1. bobodread876 commented on Aug 25, 2026

    @bobodread876
    Collaborator

    Already fixed — closing. #702 (92bb95cf7, merged 2026-08-20, six days after this was filed) implemented option 1 from the list above; the issue just never got closed.

    Verified on main rather than assumed:

    • probeLnurlFee is now a required argument of buildMaxAmountButton (max-amount-button.ts:105) — a caller that forgets to wire it fails to compile rather than silently degrading every USD LNURL send.
    • The USD LNURL branch calls it instead of the plain IBEX probe (max-amount-button.ts:222-231), and the call site mints a throwaway invoice at the probe amount purely to price it (send-bitcoin-details-screen.tsx:479). That invoice is never paid — Next mints a fresh one, which matters because they expire in 60s.
    • The dead-end itself is gone. The premise here was that MAX "deliberately falls back to filling the full balance." It no longer does: an unpriceable destination now yields { amount: 0, reason: "fee-unavailable" } (max-send-amount.ts:300-310) and the chip explains itself instead of filling the pad with an amount that will be refused. The code comment on that branch names this exact bug as the reason.

    Option 2 (a fee heuristic) was considered and explicitly rejected in that same comment — nothing in the app knows what IBEX charges, so a guessed reserve would be invention, not estimation.

    Related: #689, #690, ENG-554.

  2. bobodread876 commented on Aug 25, 2026

    @bobodread876
    Collaborator

    Fixed by #702 — see the verification above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions