aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/invoices.ts4
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;