aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-19 22:02:28 -0700
committerAdam Soltys <[email protected]>2024-10-19 22:02:28 -0700
commitab552d882ba9c0d2c99e104c79b2ce854c4d1da8 (patch)
tree7d0d591e68c9082ded5e0275674d5d11fbcb9b45 /lib
parent985230492f0c2543952bbac01378c033cced7d55 (diff)
downloadcoinos-server-ab552d882ba9c0d2c99e104c79b2ce854c4d1da8.tar.gz
coinos-server-ab552d882ba9c0d2c99e104c79b2ce854c4d1da8.zip
fix reverse
Diffstat (limited to 'lib')
-rw-r--r--lib/db.ts2
-rw-r--r--lib/payments.ts5
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/db.ts b/lib/db.ts
index 50c78e85..053ecefb 100644
--- a/lib/db.ts
+++ b/lib/db.ts
@@ -38,7 +38,7 @@ local pid = KEYS[6]
local total = tonumber(ARGV[1])
local credit = tonumber(ARGV[2])
-local payment = cjson.decode(redis.call('get', paymentKey))
+local payment = redis.call('get', paymentKey)
if payment ~= nil then
redis.call('incrby', balanceKey, total)
diff --git a/lib/payments.ts b/lib/payments.ts
index aeb16aa3..b01c926c 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -1,6 +1,5 @@
import config from "$config";
import { generate } from "$lib/invoices";
-import { emit } from "$lib/sockets";
import { v4 } from "uuid";
import { notify } from "$lib/notifications";
import { db, g, s } from "$lib/db";
@@ -257,11 +256,10 @@ export let completePayment = async (inv, p, user) => {
}
}
- notify(p, user, withdrawal);
}
+ notify(p, user, withdrawal);
l(username, "received", p.type, p.amount);
- emit(user.id, "payment", p);
callWebhook(inv, p);
};
@@ -486,7 +484,6 @@ export let sendLightning = async ({
console.log("failed to process payment", e, p);
}
} catch (e) {
- await reverse(p);
throw e;
}