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:
parent
995cfd4f0f
commit
4f099e6e51
@ -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…
Reference in New Issue
Block a user