Skip to content

Commit

Permalink
dumpchannels: fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Sep 18, 2023
1 parent f191d1b commit fe356a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/chantools/dumpchannels.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"errors"
"fmt"

"github.com/davecgh/go-spew/spew"
Expand Down Expand Up @@ -113,13 +114,14 @@ func dumpClosedChannelInfo(chanDb *channeldb.ChannelStateDB) error {
histChan, err := chanDb.FetchHistoricalChannel(
&closedChan.ChanPoint,
)
switch err {

switch {
// The channel was closed in a pre-historic version of lnd.
// Ignore the error.
case channeldb.ErrNoHistoricalBucket:
case channeldb.ErrChannelNotFound:
case errors.Is(err, channeldb.ErrNoHistoricalBucket):
case errors.Is(err, channeldb.ErrChannelNotFound):

case nil:
case err == nil:
historicalChannels[idx] = histChan

// Non-nil error not due to older versions of lnd.
Expand Down
Binary file modified cmd/chantools/testdata/wallet.db
Binary file not shown.

0 comments on commit fe356a4

Please sign in to comment.