mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 18:27:43 +02:00
multi: update linter, fix new issues
This commit is contained in:
@@ -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.
|
||||
|
@@ -1056,8 +1056,8 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
|
||||
), nil, nil
|
||||
}
|
||||
|
||||
switch err {
|
||||
case ErrInvoiceNotFound:
|
||||
switch {
|
||||
case errors.Is(err, ErrInvoiceNotFound):
|
||||
// If the invoice was not found, return a failure resolution
|
||||
// with an invoice not found result.
|
||||
return NewFailResolution(
|
||||
@@ -1065,13 +1065,13 @@ func (i *InvoiceRegistry) notifyExitHopHtlcLocked(
|
||||
ResultInvoiceNotFound,
|
||||
), nil, nil
|
||||
|
||||
case ErrInvRefEquivocation:
|
||||
case errors.Is(err, ErrInvRefEquivocation):
|
||||
return NewFailResolution(
|
||||
ctx.circuitKey, ctx.currentHeight,
|
||||
ResultInvoiceNotFound,
|
||||
), nil, nil
|
||||
|
||||
case nil:
|
||||
case err == nil:
|
||||
|
||||
default:
|
||||
ctx.log(err.Error())
|
||||
|
Reference in New Issue
Block a user