FIX: can pay negative free amount invoices

This commit is contained in:
Overtorment 2019-02-01 19:06:47 +00:00
parent e59ea298d1
commit d04b155e11

View File

@ -112,7 +112,10 @@ router.post('/payinvoice', async function(req, res) {
if (!req.body.invoice) return errorBadArguments(res);
let freeAmount = false;
if (req.body.amount) freeAmount = parseInt(req.body.amount);
if (req.body.amount) {
freeAmount = parseInt(req.body.amount);
if (freeAmount <= 0) return errorBadArguments(res);
}
// obtaining a lock
let lock = new Lock(redis, 'invoice_paying_for_' + u.getUserId());