diff options
| -rw-r--r-- | routes/payments.ts | 5 |
1 files 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" }, |
