From f4e7e676d4b10ee6cc617f42bab6c3b13a2b10be Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Thu, 11 Dec 2025 15:21:31 +0100 Subject: [PATCH] loopd: fix errors.Is argument order --- loopd/daemon.go | 8 ++++---- loopdb/store.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/loopd/daemon.go b/loopd/daemon.go index 6cbed533..8c8a9725 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -892,7 +892,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error { defer infof("Static address manager stopped") err := staticAddressManager.Run(d.mainCtx, initChan) - if err != nil && !errors.Is(context.Canceled, err) { + if err != nil && !errors.Is(err, context.Canceled) { d.internalErrChan <- err } }() @@ -924,7 +924,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error { defer infof("Static address deposit manager stopped") err := depositManager.Run(d.mainCtx, initChan) - if err != nil && !errors.Is(context.Canceled, err) { + if err != nil && !errors.Is(err, context.Canceled) { d.internalErrChan <- err } }() @@ -956,7 +956,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error { defer infof("Static address withdrawal manager stopped") err := withdrawalManager.Run(d.mainCtx, initChan) - if err != nil && !errors.Is(context.Canceled, err) { + if err != nil && !errors.Is(err, context.Canceled) { d.internalErrChan <- err } }() @@ -992,7 +992,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error { infof("Starting static address loop-in manager...") defer infof("Static address loop-in manager stopped") err := staticLoopInManager.Run(d.mainCtx, initChan) - if err != nil && !errors.Is(context.Canceled, err) { + if err != nil && !errors.Is(err, context.Canceled) { d.internalErrChan <- err } }() diff --git a/loopdb/store.go b/loopdb/store.go index 2087c76c..3dd5a6bd 100644 --- a/loopdb/store.go +++ b/loopdb/store.go @@ -194,7 +194,7 @@ func NewBoltSwapStore(dbPath string, chainParams *chaincfg.Params) ( bdb, err := bbolt.Open(path, 0600, &bbolt.Options{ Timeout: DefaultLoopDBTimeout, }) - if err == bbolt.ErrTimeout { + if errors.Is(err, bbolt.ErrTimeout) { return nil, fmt.Errorf("%w: couldn't obtain exclusive lock on "+ "%s, timed out after %v", bbolt.ErrTimeout, path, DefaultLoopDBTimeout)