Lookup invoice on lnd if not already cached as paid on redis
This commit is contained in:
@@ -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});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user