Skip to content

Commit 36838cf

Browse files
committed
multi: fix most obvious linter errors
1 parent 1cdb233 commit 36838cf

21 files changed

+41
-50
lines changed

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ func (s *Client) LoopOutQuote(ctx context.Context,
384384
return &LoopOutQuote{
385385
SwapFee: swapFee,
386386
MinerFee: minerFee,
387-
PrepayAmount: btcutil.Amount(quote.PrepayAmount),
387+
PrepayAmount: quote.PrepayAmount,
388388
SwapPaymentDest: quote.SwapPaymentDest,
389389
CltvDelta: quote.CltvDelta,
390390
}, nil

cmd/loop/loopin.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ func loopIn(ctx *cli.Context) error {
4141
args = args.Tail()
4242
default:
4343
// Show command help if no arguments and flags were provided.
44-
cli.ShowCommandHelp(ctx, "in")
45-
return nil
44+
return cli.ShowCommandHelp(ctx, "in")
4645
}
4746

4847
amt, err := parseAmt(amtStr)

cmd/loop/loopout.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ func loopOut(ctx *cli.Context) error {
5959
args = args.Tail()
6060
default:
6161
// Show command help if no arguments and flags were provided.
62-
cli.ShowCommandHelp(ctx, "out")
63-
return nil
62+
return cli.ShowCommandHelp(ctx, "out")
6463
}
6564

6665
amt, err := parseAmt(amtStr)

cmd/loop/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type limits struct {
9797
}
9898

9999
func getLimits(amt btcutil.Amount, quote *looprpc.QuoteResponse) *limits {
100-
maxSwapRoutingFee := getMaxRoutingFee(btcutil.Amount(amt))
100+
maxSwapRoutingFee := getMaxRoutingFee(amt)
101101
maxPrepayRoutingFee := getMaxRoutingFee(btcutil.Amount(
102102
quote.PrepayAmt,
103103
))
@@ -126,7 +126,7 @@ func displayLimits(swapType loop.Type, amt btcutil.Amount, l *limits,
126126
if l.maxPrepayRoutingFee != nil {
127127
totalSuccessMax += *l.maxPrepayRoutingFee
128128
}
129-
129+
130130
if swapType == loop.TypeIn && externalHtlc {
131131
fmt.Printf("On-chain fee for external loop in is not " +
132132
"included.\nSufficient fees will need to be paid " +
@@ -135,7 +135,7 @@ func displayLimits(swapType loop.Type, amt btcutil.Amount, l *limits,
135135
}
136136

137137
fmt.Printf("Max swap fees for %d Loop %v: %d\n",
138-
btcutil.Amount(amt), swapType, totalSuccessMax,
138+
amt, swapType, totalSuccessMax,
139139
)
140140

141141
fmt.Printf("CONTINUE SWAP? (y/n), expand fee detail (x): ")

cmd/loop/quote.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ func quote(ctx *cli.Context) error {
2828
// Show command help if the incorrect number arguments and/or flags were
2929
// provided.
3030
if ctx.NArg() != 1 || ctx.NumFlags() > 1 {
31-
cli.ShowCommandHelp(ctx, "quote")
32-
return nil
31+
return cli.ShowCommandHelp(ctx, "quote")
3332
}
3433

3534
args := ctx.Args()

executor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (s *executor) run(mainCtx context.Context,
6969

7070
select {
7171
case h := <-blockEpochChan:
72-
setHeight(int32(h))
72+
setHeight(h)
7373
case err := <-blockErrorChan:
7474
return err
7575
case <-mainCtx.Done():
@@ -134,10 +134,10 @@ func (s *executor) run(mainCtx context.Context,
134134
delete(blockEpochQueues, doneID)
135135

136136
case h := <-blockEpochChan:
137-
setHeight(int32(h))
137+
setHeight(h)
138138
for _, queue := range blockEpochQueues {
139139
select {
140-
case queue.ChanIn() <- int32(h):
140+
case queue.ChanIn() <- h:
141141
case <-mainCtx.Done():
142142
return mainCtx.Err()
143143
}

lndclient/invoices_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ func (s *invoicesClient) WaitForFinished() {
5252
func (s *invoicesClient) SettleInvoice(ctx context.Context,
5353
preimage lntypes.Preimage) error {
5454

55-
rpcCtx, cancel := context.WithTimeout(ctx, rpcTimeout)
55+
timeoutCtx, cancel := context.WithTimeout(ctx, rpcTimeout)
5656
defer cancel()
5757

58-
rpcCtx = s.invoiceMac.WithMacaroonAuth(ctx)
58+
rpcCtx := s.invoiceMac.WithMacaroonAuth(timeoutCtx)
5959
_, err := s.client.SettleInvoice(rpcCtx, &invoicesrpc.SettleInvoiceMsg{
6060
Preimage: preimage[:],
6161
})

lndclient/log.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package lndclient
22

33
import (
4-
"github.com/btcsuite/btclog"
54
"os"
5+
6+
"github.com/btcsuite/btclog"
67
)
78

89
// log is a logger that is initialized with no output filters. This

lndclient/router_client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import (
44
"context"
55
"encoding/hex"
66
"fmt"
7+
"time"
8+
79
"github.com/lightningnetwork/lnd/lnrpc"
810
"github.com/lightningnetwork/lnd/routing/route"
9-
"time"
1011

1112
"github.com/lightningnetwork/lnd/channeldb"
1213
"google.golang.org/grpc/codes"

log.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import (
1212
// means the package will not perform any logging by default until the caller
1313
// requests it.
1414
var (
15-
backendLog = btclog.NewBackend(logWriter{})
16-
logger = backendLog.Logger("CLIENT")
17-
servicesLogger = backendLog.Logger("SERVICES")
15+
backendLog = btclog.NewBackend(logWriter{})
16+
logger = backendLog.Logger("CLIENT")
1817
)
1918

2019
// logWriter implements an io.Writer that outputs to both standard output and

0 commit comments

Comments
 (0)