aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.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/payments.js
parent2f0f9e640ead76518f7f8013b16704da89421ee4 (diff)
downloadcoinos-server-47aa48402a0d34dd8ab11f0f315393fcc4f5c61b.tar.gz
coinos-server-47aa48402a0d34dd8ab11f0f315393fcc4f5c61b.zip
c-lightning support
Diffstat (limited to 'routes/payments.js')
-rw-r--r--routes/payments.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 4089ae23..04b5dc51 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -1,13 +1,21 @@
const BitcoinCore = require("bitcoin-core");
const lnd = require("../lib/lnd");
const { Op } = require("sequelize");
+const { join } = require("path");
(async () => {
bc = new BitcoinCore(config.bitcoin);
lq = new BitcoinCore(config.liquid);
- lna = lnd(config.lna);
- lnb = lnd(config.lnb);
+ if (config.lna.clightning) {
+ const lnapath = join(require('os').homedir(), '.lightningreg/regtest')
+ const lnbpath = join(require('os').homedir(), '.lightningregb/regtest')
+ lna = require('clightning-client')(lnapath);
+ lnb = require('clightning-client')(lnbpath);
+ } else {
+ lna = lnd(config.lna);
+ lnb = lnd(config.lnb);
+ }
seen = [];
addresses = {};
@@ -25,9 +33,7 @@ const { Op } = require("sequelize");
app.post("/send", auth, require("./send"));
app.post("/lightning/invoice", auth, require("./lightning/invoice"));
- app.post("/lightning/query", auth, require("./lightning/query"));
app.post("/lightning/send", auth, require("./lightning/send"));
- app.post("/lightning/user", auth, require("./lightning/user"));
require("./lightning/receive");
app.post("/bitcoin/send", auth, require("./bitcoin/send"));