aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-08-08 09:20:11 -0700
committerAdam Soltys <[email protected]>2025-08-08 09:20:11 -0700
commit5ffc5ee98f9850830debf97057574bed79412291 (patch)
treeffcb8d3ff21c2d958179bf6abde2ac1182e6116b
parent0da54f2b44b3421f45e7db01e0cb167f1c097289 (diff)
downloadcoinos-server-5ffc5ee98f9850830debf97057574bed79412291.tar.gz
coinos-server-5ffc5ee98f9850830debf97057574bed79412291.zip
authorization claimed flag
-rw-r--r--routes/payments.ts5
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" },