diff options
| author | Adam Soltys <[email protected]> | 2026-02-04 23:13:33 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-06 09:00:09 -0800 |
| commit | 1ebc40afc14a75d7fe157b2c6c20ffea9dedb5eb (patch) | |
| tree | 960318969072afa63536e9429c27fa40ca2919d3 /lib/lightning.ts | |
| parent | c0481268da25eed1f25281508b5c4777d26c2b03 (diff) | |
| download | coinos-server-1ebc40afc14a75d7fe157b2c6c20ffea9dedb5eb.tar.gz coinos-server-1ebc40afc14a75d7fe157b2c6c20ffea9dedb5eb.zip | |
tigerbeetle
Diffstat (limited to 'lib/lightning.ts')
| -rw-r--r-- | lib/lightning.ts | 4 |
1 files changed, 3 insertions, 1 deletions
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); } } } |
