From c5374c599a9d96507bff6ff6d5b9e1f355e89eff Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 30 May 2021 06:38:58 -0700 Subject: changes to dev environment --- routes/lightning/invoice.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'routes/lightning') diff --git a/routes/lightning/invoice.js b/routes/lightning/invoice.js index 140a3002..1f3a0528 100644 --- a/routes/lightning/invoice.js +++ b/routes/lightning/invoice.js @@ -1,13 +1,20 @@ module.exports = ah(async (req, res) => { let { amount, memo, tip } = req.body; if (!tip) tip = 0; + let value = amount + tip; try { if (config.lna.clightning) { - const invoice = await lna.invoice(`${amount + tip}sat` || "any", new Date(), memo, 360); + if (!memo) memo = "coinos"; + const invoice = await lna.invoice( + value ? `${value}sat` : "any", + new Date(), + memo, + 360 + ); res.send(invoice.bolt11); } else { - const invoice = await lna.addInvoice({ value: amount + tip, memo }); + const invoice = await lna.addInvoice({ value, memo }); res.send(invoice.payment_request); } } catch (e) { -- cgit v1.2.3