Skip to content

Skip IBEX work for inactive accounts on the LNURL-pay path - #525

Closed
nul-quill wants to merge 1 commit into
lnflash:mainfrom
nul-quill:inactive-lnurl-76
Closed

nul-quill wants to merge 1 commit into
lnflash:mainfrom
nul-quill:inactive-lnurl-76

Conversation

@nul-quill

Copy link
Copy Markdown

Closes #76.nnBoth hops of a Lightning Address payment answered for accounts that cannot use what they receive. GET /pay/lnurl/:username decoded the stored lnurlp and minted an IBEX invoice for any account the username resolved to, and �ccountDefaultWallet handed back that account's wallet (and its lnurlp) for a sending wallet to post against.nnBoth now run AccountValidator(account).isActive() immediately after the username lookup and before any wallet lookup or IBEX call - the same guard �ddInvoiceForSelf already used. The LNURL proxy answers in the LUD-01 error shape so wallets render the reason; the GraphQL query throws the mapped InactiveAccountError, the GraphQL counterpart of the same refusal.nnRegression coverage:
ew / pending / locked / closed all refuse without reaching Ibex.decodeLnurl or the presentation resolver, and �ctive still serves.

@nul-quill

Copy link
Copy Markdown
Author

Handle: nul-quill. Payout wallets: Solana USDC BdznDjc4xwt5Y6WJT5UnrFQzDptka8YnC9oqmmkKpwkd, TRC20 TNEHCVwR2aPMrj5AKfWCQ2rFL3bEDQmsg7.

An account whose status is not `active` (new / pending / locked / closed)
cannot use received funds, yet both hops of a Lightning Address payment
answered for it:

- `GET /pay/lnurl/:username` decoded the stored lnurlp and minted an invoice
  through IBEX for any account the username resolved to.
- `accountDefaultWallet` handed back the wallet — and with it `lnurlp` — of an
  inactive account, which is what a sending wallet then posts against.

Both now run `AccountValidator(account).isActive()` immediately after the
username lookup and before any wallet lookup or IBEX call. The LNURL proxy
answers in the LUD-01 error shape (`{ status: "ERROR", reason: ... }`) so
sending wallets render the reason instead of a bare failure; the GraphQL query
throws the mapped `InactiveAccountError`, the GraphQL counterpart of the same
refusal.

`addInvoiceForSelf` already guarded this way; the two lookup paths were the
ones left out.
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.

Prevent inactive accounts from receiving Lightning Address/LNURL invoices

2 participants