Skip to content

Commit 427251d

Browse files
committed
loopd: fix error checks and format
1 parent 1a04bde commit 427251d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

executor.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package loop
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"strings"
78
"sync"
@@ -159,7 +160,10 @@ func (s *executor) run(mainCtx context.Context,
159160
cancelSwap: s.executorConfig.cancelSwap,
160161
verifySchnorrSig: s.executorConfig.verifySchnorrSig,
161162
}, height)
162-
if err != nil && err != context.Canceled {
163+
if err != nil && !errors.Is(
164+
err, context.Canceled,
165+
) {
166+
163167
log.Errorf("Execute error: %v", err)
164168
}
165169

loopd/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
536536

537537
log.Info("Starting liquidity manager")
538538
err := d.liquidityMgr.Run(d.mainCtx)
539-
if err != nil && err != context.Canceled {
539+
if err != nil && !errors.Is(err, context.Canceled) {
540540
d.internalErrChan <- err
541541
}
542542

loopd/swapclient_server.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ func (s *swapClientServer) SwapInfo(_ context.Context,
510510

511511
// LoopOutTerms returns the terms that the server enforces for loop out swaps.
512512
func (s *swapClientServer) LoopOutTerms(ctx context.Context,
513-
req *clientrpc.TermsRequest) (*clientrpc.OutTermsResponse, error) {
513+
_ *clientrpc.TermsRequest) (*clientrpc.OutTermsResponse, error) {
514514

515515
log.Infof("Loop out terms request received")
516516

@@ -540,7 +540,9 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,
540540
return nil, err
541541
}
542542

543-
publicactionDeadline := getPublicationDeadline(req.SwapPublicationDeadline)
543+
publicactionDeadline := getPublicationDeadline(
544+
req.SwapPublicationDeadline,
545+
)
544546

545547
quote, err := s.impl.LoopOutQuote(ctx, &loop.LoopOutQuoteRequest{
546548
Amount: btcutil.Amount(req.Amt),
@@ -563,7 +565,7 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,
563565

564566
// GetLoopInTerms returns the terms that the server enforces for swaps.
565567
func (s *swapClientServer) GetLoopInTerms(ctx context.Context,
566-
req *clientrpc.TermsRequest) (*clientrpc.InTermsResponse, error) {
568+
_ *clientrpc.TermsRequest) (*clientrpc.InTermsResponse, error) {
567569

568570
log.Infof("Loop in terms request received")
569571

0 commit comments

Comments
 (0)