mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
multi: fix linter issues
This commit fixes outstanding linter issues, that we're not found by running `make lint` locally. The linter issues were found by running `docker run -v $(pwd):/build loop-tools golangci-lint run --whole-files` I added the `revive` to the excludes as it would be to much of a refactor and IMO seems unneccesary. E.g. `interface.go:222:6: exported: type name will be used as loop.LoopInTerms by other packages, and that stutters; consider calling this InTerms (revive)`. I think `loop.LoopInTerms` is fine.
This commit is contained in:
parent
446f163530
commit
4baf88c414
18 changed files with 32 additions and 53 deletions
11
loopin.go
11
loopin.go
|
|
@ -221,7 +221,7 @@ func newLoopInSwap(globalCtx context.Context, cfg *swapConfig,
|
|||
|
||||
// Validate the response parameters the prevent us continuing with a
|
||||
// swap that is based on parameters outside our allowed range.
|
||||
err = validateLoopInContract(cfg.lnd, currentHeight, request, swapResp)
|
||||
err = validateLoopInContract(currentHeight, swapResp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -387,11 +387,7 @@ func resumeLoopInSwap(_ context.Context, cfg *swapConfig,
|
|||
|
||||
// validateLoopInContract validates the contract parameters against our
|
||||
// request.
|
||||
func validateLoopInContract(lnd *lndclient.LndServices,
|
||||
height int32,
|
||||
request *LoopInRequest,
|
||||
response *newLoopInResponse) error {
|
||||
|
||||
func validateLoopInContract(height int32, response *newLoopInResponse) error {
|
||||
// Verify that we are not forced to publish an htlc that locks up our
|
||||
// funds for too long in case the server doesn't follow through.
|
||||
if response.expiry-height > MaxLoopInAcceptDelta {
|
||||
|
|
@ -640,7 +636,6 @@ func (s *loopInSwap) waitForHtlcConf(globalCtx context.Context) (
|
|||
var conf *chainntnfs.TxConfirmation
|
||||
for conf == nil {
|
||||
select {
|
||||
|
||||
// P2WSH htlc confirmed.
|
||||
case conf = <-confChanP2WSH:
|
||||
s.htlc = s.htlcP2WSH
|
||||
|
|
@ -756,7 +751,6 @@ func (s *loopInSwap) publishOnChainHtlc(ctx context.Context) (bool, error) {
|
|||
}
|
||||
|
||||
return true, nil
|
||||
|
||||
}
|
||||
|
||||
// getTxFee calculates our fee for a transaction that we have broadcast. We use
|
||||
|
|
@ -875,7 +869,6 @@ func (s *loopInSwap) waitForSwapComplete(ctx context.Context,
|
|||
update.State)
|
||||
|
||||
switch update.State {
|
||||
|
||||
// Swap invoice was paid, so update server cost balance.
|
||||
case channeldb.ContractSettled:
|
||||
s.cost.Server -= update.AmtPaid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue