From 1962a6dcf1bb37bb8beb3fc4c0231d5a504a75fe Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 17 Jul 2020 20:55:47 -0700 Subject: memos --- routes/lightning/invoice.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'routes/lightning/invoice.js') diff --git a/routes/lightning/invoice.js b/routes/lightning/invoice.js index 3b453a73..682fe542 100644 --- a/routes/lightning/invoice.js +++ b/routes/lightning/invoice.js @@ -1,14 +1,15 @@ module.exports = async (req, res) => { - const { amount, tip } = req.body; + const { amount, memo, tip } = req.body; l.info("adding lightning invoice", req.user.username, amount, tip); try { if (config.lna.clightning) { - const invoice = await lnb.invoice(`${amount + tip}sat` || "any", new Date(), "", 360); + const invoice = await lnb.invoice(`${amount + tip}sat` || "any", new Date(), memo, 360); res.send(invoice.bolt11); } else { - const invoice = await lnb.addInvoice({ value: amount + tip }); + const invoice = await lnb.addInvoice({ value: amount + tip, memo }); + l.info("invoice", invoice); res.send(invoice.payment_request); } } catch (e) { -- cgit v1.2.3