diff options
| author | Adam Soltys <[email protected]> | 2024-12-22 23:36:54 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-12-22 23:36:54 -0800 |
| commit | 053db6c4d155b42bfdd5bb27530ec27dd4421e26 (patch) | |
| tree | 91b3667452a791702c1ed11d72cee80857567093 /lib | |
| parent | cc1a203be0bf65612bab0d205caa4df3563bec0b (diff) | |
| download | coinos-server-053db6c4d155b42bfdd5bb27530ec27dd4421e26.tar.gz coinos-server-053db6c4d155b42bfdd5bb27530ec27dd4421e26.zip | |
check for duplicate offers
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/invoices.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/invoices.ts b/lib/invoices.ts index f89266e2..0957231a 100644 --- a/lib/invoices.ts +++ b/lib/invoices.ts @@ -90,9 +90,11 @@ export const generate = async ({ invoice, user }) => { const r = await ln.offer({ amount: amount ? `${amount + tip}sat` : "any", label: id, - description: id, + description: memo || id, }); + if (await g(`invoice:${r.offer_id}`)) fail("Duplicate offer exists"); + hash = r.bolt12; text = r.bolt12; |
