Fix channel db path issue

pull/3/head
Oliver Gugger 5 years ago
parent 995cfd4f0f
commit 4f099e6e51
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -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)
} }

@ -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),
) )

Loading…
Cancel
Save