From 1ebc40afc14a75d7fe157b2c6c20ffea9dedb5eb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 4 Feb 2026 23:13:33 -0800 Subject: tigerbeetle --- lib/lightning.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/lightning.ts') diff --git a/lib/lightning.ts b/lib/lightning.ts index 1f3b1665..e4c2e3cb 100644 --- a/lib/lightning.ts +++ b/lib/lightning.ts @@ -3,6 +3,7 @@ import ln, { lnListen, LightningUnavailableError } from "$lib/ln"; import { err, l, warn } from "$lib/logging"; import { handleZap } from "$lib/nostr"; import { credit } from "$lib/payments"; +import { tbSetBalance, getBalance } from "$lib/tb"; import { PaymentType } from "$lib/types"; import { getInvoice, getPayment, getUser } from "$lib/utils"; @@ -181,7 +182,8 @@ export const fixBolt12 = async (_, res) => { if (op) { db.del(`payment:${oid}`); db.del(`payment:${local_offer_id}`); - db.decrBy(`balance:${op.uid}`, op.amount); + const bal = await getBalance(op.uid); + await tbSetBalance(op.uid, bal - op.amount); } } } -- cgit v1.2.3