aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/query.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-05-03 11:16:41 -0700
committerAdam Soltys <[email protected]>2020-05-03 11:16:41 -0700
commit6c9b2db32e4c20fea13031ed74f47086123c7539 (patch)
tree4b147bf435a7ab0ea7f7e0707449f754ac8af9ed /routes/lightning/query.js
parentc2f6dd746000d561750d1e32c05cc814e39a40ce (diff)
downloadcoinos-server-6c9b2db32e4c20fea13031ed74f47086123c7539.tar.gz
coinos-server-6c9b2db32e4c20fea13031ed74f47086123c7539.zip
take amount param for lightning send
Diffstat (limited to 'routes/lightning/query.js')
-rw-r--r--routes/lightning/query.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/routes/lightning/query.js b/routes/lightning/query.js
index c980b0c0..6f0dccbf 100644
--- a/routes/lightning/query.js
+++ b/routes/lightning/query.js
@@ -1,11 +1,11 @@
const bolt11 = require("bolt11");
module.exports = async (req, res) => {
- let hash = req.body.payreq;
- let payreq = bolt11.decode(hash);
+ let { amount, payreq } = req.body;
+ payreq = bolt11.decode(payreq);
try {
- res.send(await lna.queryRoutes({ pub_key: payreq.payeeNodeKey, amt: payreq.satoshis }));
+ res.send(await lna.queryRoutes({ pub_key: payreq.payeeNodeKey, amt: amount || payreq.satoshis }));
} catch (e) {
res.status(500).send(e.message);
}