aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/query.js
diff options
context:
space:
mode:
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);
}