From 76065e84d3adb1e5f9b148b49d28829e4d04f281 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Mon, 1 Nov 2021 10:10:00 +0100 Subject: [PATCH] invoices: do not log when invoice is already deleted --- docs/release-notes/release-notes-0.14.0.md | 3 +++ invoices/invoice_expiry_watcher.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/docs/release-notes/release-notes-0.14.0.md b/docs/release-notes/release-notes-0.14.0.md index eb013ee94..0412470f7 100644 --- a/docs/release-notes/release-notes-0.14.0.md +++ b/docs/release-notes/release-notes-0.14.0.md @@ -584,6 +584,9 @@ messages directly. There is no routing/path finding involved. re-notified](https://github.com/lightningnetwork/lnd/pull/5901), which could lead to higher-level HTLC mismanagement issues. +* [Do not error log when an invoice that has been canceled and GC'd is expired]( + https://github.com/lightningnetwork/lnd/pull/5913) + ## Documentation The [code contribution guidelines have been updated to mention the new diff --git a/invoices/invoice_expiry_watcher.go b/invoices/invoice_expiry_watcher.go index 70d73608e..9140d9862 100644 --- a/invoices/invoice_expiry_watcher.go +++ b/invoices/invoice_expiry_watcher.go @@ -353,6 +353,11 @@ func (ew *InvoiceExpiryWatcher) expireInvoice(hash lntypes.Hash, force bool) { case channeldb.ErrInvoiceAlreadySettled: + case channeldb.ErrInvoiceNotFound: + // It's possible that the user has manually canceled the invoice + // which will then be deleted by the garbage collector resulting + // in an ErrInvoiceNotFound error. + default: log.Errorf("Unable to cancel invoice: %v: %v", hash, err) }