Skip to content

Commit 4f099e6

Browse files
committed
Fix channel db path issue
1 parent 995cfd4 commit 4f099e6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/chantools/forceclose.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ func (c *forceCloseCommand) Execute(_ []string) error {
4848
if c.ChannelDB == "" {
4949
return fmt.Errorf("rescue DB is required")
5050
}
51-
db, err := channeldb.Open(path.Dir(c.ChannelDB))
51+
db, err := channeldb.Open(
52+
path.Dir(c.ChannelDB),channeldb.OptionSetSyncFreelist(true),
53+
channeldb.OptionReadOnly(true),
54+
)
5255
if err != nil {
5356
return fmt.Errorf("error opening rescue DB: %v", err)
5457
}

cmd/chantools/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/lightningnetwork/lnd/chanbackup"
99
"io/ioutil"
1010
"os"
11+
"path"
1112
"strings"
1213
"syscall"
1314
"time"
@@ -148,7 +149,7 @@ func parseInputType(cfg *config) ([]*dataformat.SummaryEntry, error) {
148149

149150
case cfg.FromChannelDB != "":
150151
db, err := channeldb.Open(
151-
cfg.FromChannelDB,
152+
path.Dir(cfg.FromChannelDB),
152153
channeldb.OptionSetSyncFreelist(true),
153154
channeldb.OptionReadOnly(true),
154155
)

0 commit comments

Comments
 (0)