Mint should check state of unpaid mint quotes per request #587

Closed
opened 2025-02-07 16:35:04 +00:00 by callebtc · 1 comment
callebtc commented 2025-02-07 16:35:04 +00:00 (Migrated from github.com)

Currently, the mint relies on a stable incoming invoice stream to update the in-db mint quote states. This also requires a startup routine that checks all pending and unpaid mint quotes because they could've been paid during downtime. The list of unpaid mint quotes could become very large delaying or even preventing future startups.

Instead of this, the mint should rely on the invoice stream only for updating the mint quote state in the db and for the websocket functionality. We would need to add an ln.check_incoming_invoice_status when the user makes a request on an unpaid mint quote.

check_mint_quote should therefore

  1. load the mint quote from the db
  2. if the quote is unpaid, call ln.check_incoming_invoice_status.
  3. if the result of ln.check_incoming_invoice_status is PAID, update the mint quote in the db
  4. return mint quote to user

process_mint_request should do the same, but instead of returning at 4, it should error if the mint quote stat is not PAID.

Currently, the mint relies on a stable incoming invoice stream to update the in-db mint quote states. This also requires a startup routine that checks all pending and unpaid mint quotes because they could've been paid during downtime. The list of unpaid mint quotes could become very large delaying or even preventing future startups. Instead of this, the mint should rely on the invoice stream only for updating the mint quote state in the db and for the websocket functionality. We would need to add an `ln.check_incoming_invoice_status` when the user makes a request on an unpaid mint quote. `check_mint_quote` should therefore 1) load the mint quote from the db 2) if the quote is unpaid, call ln.check_incoming_invoice_status. 3) if the result of `ln.check_incoming_invoice_status` is `PAID`, update the mint quote in the db 4) return mint quote to user `process_mint_request` should do the same, but instead of returning at 4, it should error if the mint quote stat is not `PAID`.
thesimplekid commented 2025-02-09 11:34:06 +00:00 (Migrated from github.com)

closed by #591

closed by #591
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk#587
No description provided.