diff options
| author | Adam Soltys <[email protected]> | 2025-08-08 09:20:11 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-08-08 09:20:11 -0700 |
| commit | 5ffc5ee98f9850830debf97057574bed79412291 (patch) | |
| tree | ffcb8d3ff21c2d958179bf6abde2ac1182e6116b | |
| parent | 0da54f2b44b3421f45e7db01e0cb167f1c097289 (diff) | |
| download | coinos-server-5ffc5ee98f9850830debf97057574bed79412291.tar.gz coinos-server-5ffc5ee98f9850830debf97057574bed79412291.zip | |
authorization claimed flag
| -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" }, |
