diff options
| author | Adam Soltys <[email protected]> | 2022-11-24 14:04:22 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-24 14:04:22 -0800 |
| commit | a675c1992fa58ad04b04a222a1123321268c7af1 (patch) | |
| tree | 90e4da60a3104c99adfeaa820ec9b00496206538 /routes/lightning | |
| parent | c3f0689dc728b2ed86792ad180132165479c05d5 (diff) | |
| download | coinos-server-a675c1992fa58ad04b04a222a1123321268c7af1.tar.gz coinos-server-a675c1992fa58ad04b04a222a1123321268c7af1.zip | |
remove lnd support
Diffstat (limited to 'routes/lightning')
| -rw-r--r-- | routes/lightning/invoice.js | 1 | ||||
| -rw-r--r-- | routes/lightning/receive.js | 55 |
2 files changed, 26 insertions, 30 deletions
diff --git a/routes/lightning/invoice.js b/routes/lightning/invoice.js index b5d90faf..ae974120 100644 --- a/routes/lightning/invoice.js +++ b/routes/lightning/invoice.js @@ -1,6 +1,5 @@ import config from "$config"; import { err } from "$lib/logging"; -import lnd from "$lib/lnd"; import ln from "$lib/ln"; import { v4 } from "uuid"; diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index af8415f1..ef973acc 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -6,7 +6,6 @@ import { notify } from "$lib/notifications"; import { callWebhook } from "$lib/webhooks"; import { computeConversionFee } from "./conversionFee"; import { sendLiquid } from "$routes/liquid/send"; -import lnd from "$lib/lnd"; import ln from "$lib/ln"; import { l, err, warn } from "$lib/logging"; @@ -131,35 +130,33 @@ const handlePayment = async msg => { } }; -if (config.lna.clightning) { - const poll = async ln => { - try { - const wait = async i => { - const { - bolt11: request, - pay_index, - status, - msatoshi_received, - payment_preimage: secret - } = await ln.waitanyinvoice(i); +const poll = async ln => { + try { + const wait = async i => { + const { + bolt11: request, + pay_index, + status, + msatoshi_received, + payment_preimage: secret + } = await ln.waitanyinvoice(i); - let settled = status === "paid"; - let received = parseInt(msatoshi_received / 1000); + let settled = status === "paid"; + let received = parseInt(msatoshi_received / 1000); - await handlePayment({ - request, - received, - secret - }); - await wait(pay_index); - }; + await handlePayment({ + request, + received, + secret + }); + await wait(pay_index); + }; - const { invoices } = await ln.listinvoices(); - await wait(Math.max(...invoices.map(i => i.pay_index).filter(n => n))); - } catch (e) { - err("problem waiting for c-lightning invoice", e.message); - } - }; + const { invoices } = await ln.listinvoices(); + await wait(Math.max(...invoices.map(i => i.pay_index).filter(n => n))); + } catch (e) { + err("problem waiting for c-lightning invoice", e.message); + } +}; - poll(ln); -} +poll(ln); |
