From 5ffc5ee98f9850830debf97057574bed79412291 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 8 Aug 2025 09:20:11 -0700 Subject: authorization claimed flag --- routes/payments.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/payments.ts b/routes/payments.ts index 82caa4c6..1aab736f 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -283,12 +283,13 @@ export default { } const authorization = await g(`authorization:${id}`); - if (authorization) { + if (authorization && !authorization.claimed) { const { currency, fiat } = authorization; amount = sats(fiat / rates[currency]); const sender = await getUser(authorization.uid); - await db.del(`authorization:${id}`); + authorization.claimed = true; + await s(`authorization:${id}`, authorization); const { hash } = await generate({ invoice: { amount, type: "lightning" }, -- cgit v1.2.3