From b53875cf6bdf47c359139aa846c6597fa3627c87 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 20 Sep 2022 22:48:01 -0700 Subject: clightning support --- routes/lightning/channel.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'routes/lightning/channel.js') diff --git a/routes/lightning/channel.js b/routes/lightning/channel.js index 1c7bab10..107896f4 100644 --- a/routes/lightning/channel.js +++ b/routes/lightning/channel.js @@ -1,6 +1,7 @@ import axios from "axios"; import { addPeer, getIdentity } from "lightning"; import lnd from "$lib/lnd"; +import ln from "$lib/ln"; export default async (req, res) => { const { params } = req.body; @@ -24,7 +25,11 @@ export default async (req, res) => { const { callback, k1 } = params; let remoteid; try { - remoteid = (await getIdentity({ lnd })).public_key; + if (config.lna.clightning) { + remoteid = (await ln.getinfo()).id; + } else { + remoteid = (await getIdentity({ lnd })).public_key; + } } catch (e) { err("problem getting lightning node info", e.message); return res.code(500).send(e.message); -- cgit v1.2.3