Lookup invoice on lnd if not already cached as paid on redis

This commit is contained in:
Agustin Kassis
2020-04-01 22:58:24 -03:00
parent 7afb56398a
commit ea1035e414
2 changed files with 16 additions and 8 deletions

View File

@@ -266,7 +266,10 @@ router.get('/checkpayment/:payment_hash', async function(req, res) {
return errorBadAuth(res);
}
let paid = !!(await u.getPaymentHashPaid(req.params.payment_hash));
let paid = true;
if (!(await u.getPaymentHashPaid(req.params.payment_hash))) { // Not found on cache
paid = await u.syncInvoicePaid(req.params.payment_hash);
}
res.send({paid: paid});
});