mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopd: fix error checks and format
This commit is contained in:
parent
1a04bde34a
commit
427251d176
3 changed files with 11 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue