multi: update linter, fix new issues

This commit is contained in:
Oliver Gugger
2024-08-20 12:46:24 +02:00
parent 9eef428e77
commit e99e6662cf
21 changed files with 453 additions and 441 deletions

View File

@@ -1,6 +1,7 @@
package invoices
import (
"errors"
"fmt"
"sync"
"time"
@@ -345,14 +346,14 @@ func (ew *InvoiceExpiryWatcher) cancelNextHeightExpiredInvoice() {
// unexpected error.
func (ew *InvoiceExpiryWatcher) expireInvoice(hash lntypes.Hash, force bool) {
err := ew.cancelInvoice(hash, force)
switch err {
case nil:
switch {
case err == nil:
case ErrInvoiceAlreadyCanceled:
case errors.Is(err, ErrInvoiceAlreadyCanceled):
case ErrInvoiceAlreadySettled:
case errors.Is(err, ErrInvoiceAlreadySettled):
case ErrInvoiceNotFound:
case errors.Is(err, 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.