Merge pull request #5224 from bhandras/invoice-gc-errors

invoices: do not fail DeleteInvoice if payment addr isn't indexed
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2021-04-29 15:39:35 -07:00
commit 41c089fbf4
3 files changed
+22 -20

No files matched your search

+9 -2
View File
@@ -213,8 +213,15 @@ func (i *InvoiceRegistry) scanInvoicesOnStart() error {
len(pending))
i.expiryWatcher.AddInvoices(pending...)
if err := i.cdb.DeleteInvoice(removable); err != nil {
log.Warnf("Deleting old invoices failed: %v", err)
if len(removable) > 0 {
log.Infof("Attempting to delete %v canceled invoices",
len(removable))
if err := i.cdb.DeleteInvoice(removable); err != nil {
log.Warnf("Deleting canceled invoices failed: %v", err)
} else {
log.Infof("Deleted %v canceled invoices",
len(removable))
}
}
return nil