2
0
mirror of https://github.com/guggero/chantools synced 2024-11-11 01:10:42 +00:00

Fix channel db path issue

This commit is contained in:
Oliver Gugger 2020-03-10 10:46:53 +01:00
parent 995cfd4f0f
commit 4f099e6e51
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
2 changed files with 6 additions and 2 deletions

View File

@ -48,7 +48,10 @@ func (c *forceCloseCommand) Execute(_ []string) error {
if c.ChannelDB == "" { if c.ChannelDB == "" {
return fmt.Errorf("rescue DB is required") return fmt.Errorf("rescue DB is required")
} }
db, err := channeldb.Open(path.Dir(c.ChannelDB)) db, err := channeldb.Open(
path.Dir(c.ChannelDB),channeldb.OptionSetSyncFreelist(true),
channeldb.OptionReadOnly(true),
)
if err != nil { if err != nil {
return fmt.Errorf("error opening rescue DB: %v", err) return fmt.Errorf("error opening rescue DB: %v", err)
} }

View File

@ -8,6 +8,7 @@ import (
"github.com/lightningnetwork/lnd/chanbackup" "github.com/lightningnetwork/lnd/chanbackup"
"io/ioutil" "io/ioutil"
"os" "os"
"path"
"strings" "strings"
"syscall" "syscall"
"time" "time"
@ -148,7 +149,7 @@ func parseInputType(cfg *config) ([]*dataformat.SummaryEntry, error) {
case cfg.FromChannelDB != "": case cfg.FromChannelDB != "":
db, err := channeldb.Open( db, err := channeldb.Open(
cfg.FromChannelDB, path.Dir(cfg.FromChannelDB),
channeldb.OptionSetSyncFreelist(true), channeldb.OptionSetSyncFreelist(true),
channeldb.OptionReadOnly(true), channeldb.OptionReadOnly(true),
) )