Skip to content

Redirect multi-part invoice payments to pay-from-wallet - #985

Merged
dangershony merged 1 commit into
mainfrom
fix/multi-utxo-pay-from-wallet
Oct 15, 2026
Merged

dangershony merged 1 commit into
mainfrom
fix/multi-utxo-pay-from-wallet

Conversation

@dangershony

Copy link
Copy Markdown
Member

Problem

When an on-chain invoice is paid in 2+ transactions, the invest flow builds the investment from the funding address, which spends every coin on it. The fee is sized for one input, so signing fails with "Insufficient funds".

Change (src/design/App, PaymentFlowViewModel)

  • Single detected coin: unchanged.
  • More than one coin: skip the post-payment callback, refresh the wallet balance, and show a new PaidInParts screen. It explains the payment arrived in multiple parts, the funds are now in the wallet, and the user should pay from the wallet. It also says to add funds to the wallet, not to send more to the invoice address. A button returns to the wallet selector.
  • Monitor failure (e.g. timeout): if the wallet balance increased after a refresh, show the same screen instead of a bare error. The poller only counts mempool UTXOs, so a payment that confirms mid-wait disappears from the monitor but is still in the wallet.
  • AddInputsAndSignTransaction does not exclude unconfirmed UTXOs, so no confirmation caveat is shown.

Supersedes #930. No SDK, estimator or web app changes, and no top-up loop.

Tests

  • New PaymentFlowMultiPartPaymentTests (single coin, multi coin, timeout with balance increase, timeout without).
  • Shared, SDK and LayoutRegression tests pass; App.Desktop builds clean.

Manual signet test plan

  1. Start an invest flow and open the on-chain invoice.
  2. Pay it with two separate sends that together cover the amount.
  3. Confirm the app shows "Your funds are in your wallet" and does not try to invest from the invoice address.
  4. Tap "Pay from my wallet", pick the wallet, and confirm the investment completes.
  5. Repeat with one send that confirms while waiting, and confirm the same redirect.

@dangershony
dangershony merged commit 240cad7 into main Oct 15, 2026
3 checks passed
@dangershony
dangershony deleted the fix/multi-utxo-pay-from-wallet branch October 15, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant