Skip to content

Commit 6504656

Browse files
authored
Merge pull request #9079 from ziggie1984/remove-unsupported-nolint-directive
chanfunding: remove unsupported linter directive.
2 parents 556c664 + 6f26f2a commit 6504656

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lnwallet/chanfunding/coin_select.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ func CoinSelectUpToAmount(feeRate chainfee.SatPerKWeight, minAmount, maxAmount,
373373
)
374374

375375
var errInsufficientFunds *ErrInsufficientFunds
376-
if err == nil { //nolint:gocritic,ifElseChain
376+
switch {
377+
case err == nil:
377378
// If the coin selection succeeds we check if our total balance
378379
// covers the selected set of coins including fees plus an
379380
// optional anchor reserve.
@@ -396,11 +397,13 @@ func CoinSelectUpToAmount(feeRate chainfee.SatPerKWeight, minAmount, maxAmount,
396397
// our total balance minus reserve and fees.
397398
selectSubtractFee = true
398399
}
399-
} else if errors.As(err, &errInsufficientFunds) {
400+
401+
case errors.As(err, &errInsufficientFunds):
400402
// If the initial coin selection fails due to insufficient funds
401403
// we select our total available balance minus fees.
402404
selectSubtractFee = true
403-
} else {
405+
406+
default:
404407
return nil, 0, 0, err
405408
}
406409

0 commit comments

Comments
 (0)