From 23e835c888116264206694803498e4d25d0cea34 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sun, 3 Mar 2019 22:01:15 +0000 Subject: [PATCH] FIX: fees --- controllers/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/api.js b/controllers/api.js index 5d44aa1..d219d0b 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -139,8 +139,8 @@ router.post('/payinvoice', async function(req, res) { logger.log('/payinvoice', [req.id, 'userBalance: ' + userBalance, 'num_satoshis: ' + info.num_satoshis]); - if (userBalance >= info.num_satoshis) { - // got enough balance + if (userBalance >= +info.num_satoshis + Math.floor(info.num_satoshis * 0.01)) { + // got enough balance, including 1% of payment amount - reserve for fees if (identity_pubkey === info.destination) { // this is internal invoice