loopd: fix error checks and format

pull/662/head
Slyghtning 5 months ago
parent 1a04bde34a
commit 427251d176
No known key found for this signature in database
GPG Key ID: F82D456EA023C9BF

@ -2,6 +2,7 @@ package loop
import (
"context"
"errors"
"fmt"
"strings"
"sync"
@ -159,7 +160,10 @@ func (s *executor) run(mainCtx context.Context,
cancelSwap: s.executorConfig.cancelSwap,
verifySchnorrSig: s.executorConfig.verifySchnorrSig,
}, height)
if err != nil && err != context.Canceled {
if err != nil && !errors.Is(
err, context.Canceled,
) {
log.Errorf("Execute error: %v", err)
}

@ -536,7 +536,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
log.Info("Starting liquidity manager")
err := d.liquidityMgr.Run(d.mainCtx)
if err != nil && err != context.Canceled {
if err != nil && !errors.Is(err, context.Canceled) {
d.internalErrChan <- err
}

@ -510,7 +510,7 @@ func (s *swapClientServer) SwapInfo(_ context.Context,
// LoopOutTerms returns the terms that the server enforces for loop out swaps.
func (s *swapClientServer) LoopOutTerms(ctx context.Context,
req *clientrpc.TermsRequest) (*clientrpc.OutTermsResponse, error) {
_ *clientrpc.TermsRequest) (*clientrpc.OutTermsResponse, error) {
log.Infof("Loop out terms request received")
@ -540,7 +540,9 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,
return nil, err
}
publicactionDeadline := getPublicationDeadline(req.SwapPublicationDeadline)
publicactionDeadline := getPublicationDeadline(
req.SwapPublicationDeadline,
)
quote, err := s.impl.LoopOutQuote(ctx, &loop.LoopOutQuoteRequest{
Amount: btcutil.Amount(req.Amt),
@ -563,7 +565,7 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,
// GetLoopInTerms returns the terms that the server enforces for swaps.
func (s *swapClientServer) GetLoopInTerms(ctx context.Context,
req *clientrpc.TermsRequest) (*clientrpc.InTermsResponse, error) {
_ *clientrpc.TermsRequest) (*clientrpc.InTermsResponse, error) {
log.Infof("Loop in terms request received")

Loading…
Cancel
Save