aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/query.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-05-07 20:15:56 -0700
committerAdam Soltys <[email protected]>2020-05-07 20:58:24 -0700
commit47aa48402a0d34dd8ab11f0f315393fcc4f5c61b (patch)
tree2e907e64628d26c4707660e854e9bc87b332ff08 /routes/lightning/query.js
parent2f0f9e640ead76518f7f8013b16704da89421ee4 (diff)
downloadcoinos-server-47aa48402a0d34dd8ab11f0f315393fcc4f5c61b.tar.gz
coinos-server-47aa48402a0d34dd8ab11f0f315393fcc4f5c61b.zip
c-lightning support
Diffstat (limited to 'routes/lightning/query.js')
-rw-r--r--routes/lightning/query.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/routes/lightning/query.js b/routes/lightning/query.js
deleted file mode 100644
index 6e70f30a..00000000
--- a/routes/lightning/query.js
+++ /dev/null
@@ -1,28 +0,0 @@
-const bolt11 = require("bolt11");
-
-module.exports = async (req, res) => {
- let { amount, payreq } = req.body;
-
- try {
- let invoice = await db.Invoice.findOne({
- where: { text: payreq },
- include: {
- model: db.User,
- as: "user"
- }
- });
-
- if (invoice) emit(req.user.username, "to", invoice.user);
-
- payreq = bolt11.decode(payreq);
-
- res.send(
- await lna.queryRoutes({
- pub_key: payreq.payeeNodeKey,
- amt: amount || payreq.satoshis
- })
- );
- } catch (e) {
- res.status(500).send(e.message);
- }
-};