lntest: add new ChanBackupPath method to expose channels.backup for node
This commit is contained in:
parent
b419179c86
commit
d9c9d6ed73
@ -25,6 +25,7 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/go-errors/errors"
|
||||
"github.com/lightningnetwork/lnd/chanbackup"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
)
|
||||
@ -142,6 +143,16 @@ func (cfg nodeConfig) DBPath() string {
|
||||
fmt.Sprintf("%v/channel.db", cfg.NetParams.Name))
|
||||
}
|
||||
|
||||
func (cfg nodeConfig) ChanBackupPath() string {
|
||||
return filepath.Join(
|
||||
cfg.DataDir, "chain", "bitcoin",
|
||||
fmt.Sprintf(
|
||||
"%v/%v", cfg.NetParams.Name,
|
||||
chanbackup.DefaultBackupFileName,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
// genArgs generates a slice of command line arguments from the lightning node
|
||||
// config struct.
|
||||
func (cfg nodeConfig) genArgs() []string {
|
||||
@ -279,6 +290,12 @@ func (hn *HarnessNode) Name() string {
|
||||
return hn.cfg.Name
|
||||
}
|
||||
|
||||
// ChanBackupPath returns the fielpath to the on-disk channels.backup file for
|
||||
// this node.
|
||||
func (hn *HarnessNode) ChanBackupPath() string {
|
||||
return hn.cfg.ChanBackupPath()
|
||||
}
|
||||
|
||||
// Start launches a new process running lnd. Additionally, the PID of the
|
||||
// launched process is saved in order to possibly kill the process forcibly
|
||||
// later.
|
||||
|
Loading…
Reference in New Issue
Block a user