diff options
| author | Adam Soltys <[email protected]> | 2025-03-05 13:35:31 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-03-05 15:06:48 -0800 |
| commit | bbdae13248476e9ff49fcefc64cf8c8e97b5f679 (patch) | |
| tree | cb3696e680f7417f5988375043341e495b7cad3d /lib/invoices.ts | |
| parent | 118386e0691a0c80a0d8c19ab40bd3abf6859b84 (diff) | |
| download | coinos-server-bbdae13248476e9ff49fcefc64cf8c8e97b5f679.tar.gz coinos-server-bbdae13248476e9ff49fcefc64cf8c8e97b5f679.zip | |
use getInvoice helper
Diffstat (limited to 'lib/invoices.ts')
| -rw-r--r-- | lib/invoices.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/invoices.ts b/lib/invoices.ts index 178f793a..f6ad65e8 100644 --- a/lib/invoices.ts +++ b/lib/invoices.ts @@ -3,7 +3,7 @@ import { db, g, s } from "$lib/db"; import { request } from "$lib/ecash"; import ln from "$lib/ln"; import { emit } from "$lib/sockets"; -import { SATS, bip21, fail, getUser } from "$lib/utils"; +import { SATS, bip21, fail, getInvoice, getUser } from "$lib/utils"; import rpc from "@coinos/rpc"; import { v4 } from "uuid"; @@ -95,7 +95,7 @@ export const generate = async ({ invoice, user }) => { description: memo || id, }); - if (await g(`invoice:${r.offer_id}`)) fail("Duplicate offer exists"); + if (await getInvoice(r.offer_id)) fail("Duplicate offer exists"); hash = r.bolt12; text = r.bolt12; |
