This commit is contained in:
Overtorment
2019-04-04 12:51:46 +01:00
parent 0f423817c3
commit 75bfac565c
4 changed files with 6 additions and 3 deletions

View File

@@ -246,13 +246,14 @@ export class User {
}
invoice.ispaid = !!(await this.getPaymentHashPaid(invoice.payment_hash));
if (!invoice.ispaid) {
// TODO: check if expired
// attempting to lookup invoice
let lookup_info = await this.lookupInvoice(invoice.payment_hash);
invoice.ispaid = lookup_info.settled;
if (invoice.ispaid) {
// so invoice was paid after all
await this.setPaymentHashPaid(invoice.payment_hash);
await this.saveBalance(await this.getCalculatedBalance());
await this.clearBalanceCache();
}
}