From 13352f9b30eed52d2e7d0970d3cbd76f401d6de0 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 2 Sep 2022 22:12:24 -0700 Subject: es6 migration --- routes/lightning/receive.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'routes/lightning') diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index e35d91ec..f013efd7 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -1,7 +1,9 @@ +import config from "../../config/index.js"; import { notify } from "../../lib/notifications.js"; import { callWebhook } from "../../lib/webhooks.js"; import { computeConversionFee } from './conversionFee.js'; import { sendLiquid } from "../liquid/send.js"; +import ln from "../../lib/ln.js"; const handlePayment = async (msg) => { l("incoming lightning payment", msg.value, msg.payment_request, msg.settled); @@ -147,8 +149,8 @@ if (config.lna.clightning) { wait(Math.max(...invoices.map((i) => i.pay_index).filter((n) => n))); }; - poll(lna); + poll(ln); } else { - const invoices = lna.subscribeInvoices({}); + const invoices = ln.subscribeInvoices({}); invoices.on("data", handlePayment); } -- cgit v1.2.3