Skip to content

Commit fe356a4

Browse files
committed
dumpchannels: fix linter error
1 parent f191d1b commit fe356a4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cmd/chantools/dumpchannels.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"errors"
45
"fmt"
56

67
"github.com/davecgh/go-spew/spew"
@@ -113,13 +114,14 @@ func dumpClosedChannelInfo(chanDb *channeldb.ChannelStateDB) error {
113114
histChan, err := chanDb.FetchHistoricalChannel(
114115
&closedChan.ChanPoint,
115116
)
116-
switch err {
117+
118+
switch {
117119
// The channel was closed in a pre-historic version of lnd.
118120
// Ignore the error.
119-
case channeldb.ErrNoHistoricalBucket:
120-
case channeldb.ErrChannelNotFound:
121+
case errors.Is(err, channeldb.ErrNoHistoricalBucket):
122+
case errors.Is(err, channeldb.ErrChannelNotFound):
121123

122-
case nil:
124+
case err == nil:
123125
historicalChannels[idx] = histChan
124126

125127
// Non-nil error not due to older versions of lnd.

cmd/chantools/testdata/wallet.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)