From 42ee5f1a90c8224f402bae9e996bd1829d7af721 Mon Sep 17 00:00:00 2001 From: hatim boufnichel Date: Mon, 17 Aug 2020 18:45:38 +0200 Subject: [PATCH] limt routing fee --- src/routes.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/routes.js b/src/routes.js index 688c558b..1091a96e 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1432,7 +1432,13 @@ module.exports = async ( const { router } = LightningServices.services // this is the recommended value from lightning labs let paymentRequest = {} - const { keysend, maxParts = 3, timeoutSeconds = 5 } = req.body + const { keysend, maxParts = 3, timeoutSeconds = 5, feeLimit } = req.body + logger.error('FEE LIMIT', feeLimit) + if (!feeLimit) { + return res.status(500).json({ + errorMessage: 'please provide a "feeLimit" to the send payment request' + }) + } if (keysend) { const { dest, amt, finalCltvDelta = 40 } = req.body if (!dest || !amt) { @@ -1460,7 +1466,8 @@ module.exports = async ( payment_hash: r_hash, max_parts: maxParts, timeout_seconds: timeoutSeconds, - no_inflight_updates: true + no_inflight_updates: true, + fee_limit_sat: feeLimit } } else { const { payreq } = req.body @@ -1469,7 +1476,8 @@ module.exports = async ( payment_request: payreq, max_parts: maxParts, timeout_seconds: timeoutSeconds, - no_inflight_updates: true + no_inflight_updates: true, + fee_limit_sat: feeLimit } if (req.body.amt) {