FIX: balance deduction

This commit is contained in:
Overtorment
2018-12-04 00:24:34 +00:00
parent 69ca994daf
commit 6a4bc0f85d
2 changed files with 3 additions and 3 deletions

View File

@@ -133,7 +133,7 @@ router.post('/payinvoice', async function(req, res) {
call.on('data', function(payment) {
// payment callback
if (payment && payment.payment_route && payment.payment_route.total_amt_msat) {
userBalance -= parseInt((+payment.payment_route.total_fees_msat + +payment.payment_route.total_amt_msat) / 1000);
userBalance -= +payment.payment_route.total_fees + +payment.payment_route.total_amt;
u.saveBalance(userBalance);
payment.pay_req = req.body.invoice;
payment.decoded = info;