aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-04 14:05:09 -0800
committerAdam Soltys <[email protected]>2026-02-06 08:59:46 -0800
commitc0481268da25eed1f25281508b5c4777d26c2b03 (patch)
treef04cd4feacd920029dc5cfcb145a9debe329cad6 /routes/payments.ts
parent384c4778ca5421c091a7d282b90b00965f3596cd (diff)
downloadcoinos-server-c0481268da25eed1f25281508b5c4777d26c2b03.tar.gz
coinos-server-c0481268da25eed1f25281508b5c4777d26c2b03.zip
remove reconcile payments
Diffstat (limited to 'routes/payments.ts')
-rw-r--r--routes/payments.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/routes/payments.ts b/routes/payments.ts
index b14dc588..f9225b87 100644
--- a/routes/payments.ts
+++ b/routes/payments.ts
@@ -497,6 +497,12 @@ export default {
const invoice = await getInvoice(address);
if (!hot && aid !== invoice?.aid) continue;
if (sats(amount) < 300) continue;
+
+ const lockKey = `lock:${txid}:${vout}`;
+ const locked = await db.setNX(lockKey, "1");
+ if (!locked) continue;
+ await db.expire(lockKey, 60);
+
await credit({
hash: address,
amount: sats(amount),