mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
config: fix empty default remote lnd admin mac path
Partially revertsc917e91fand fixes #195: The default remote lnd admin macaroon path we added inc917e91fwas a mistake since by default that value isn't set until we call lnd.ValidateConfig() which we never do in the remote mode. We fix this by providing a sane default value for the admin macaroon again.
This commit is contained in:
parent
1724184744
commit
cbe71ac19a
1 changed files with 10 additions and 2 deletions
12
config.go
12
config.go
|
|
@ -65,6 +65,7 @@ const (
|
|||
defaultRemotePoolRpcServer = "localhost:12010"
|
||||
defaultLndChainSubDir = "chain"
|
||||
defaultLndChain = "bitcoin"
|
||||
defaultLndMacaroon = "admin.macaroon"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -104,6 +105,13 @@ var (
|
|||
defaultLetsEncryptDir = filepath.Join(
|
||||
defaultLitDir, defaultLetsEncryptSubDir,
|
||||
)
|
||||
|
||||
// defaultRemoteLndMacaroonPath is the default path we assume for a
|
||||
// local lnd node to store its admin.macaroon file at.
|
||||
defaultRemoteLndMacaroonPath = filepath.Join(
|
||||
lndDefaultConfig.DataDir, defaultLndChainSubDir,
|
||||
defaultLndChain, defaultNetwork, defaultLndMacaroon,
|
||||
)
|
||||
)
|
||||
|
||||
// Config is the main configuration struct of lightning-terminal. It contains
|
||||
|
|
@ -248,7 +256,7 @@ func defaultConfig() *Config {
|
|||
LitMaxLogFileSize: defaultMaxLogFileSize,
|
||||
Lnd: &RemoteDaemonConfig{
|
||||
RPCServer: defaultRemoteLndRpcServer,
|
||||
MacaroonPath: lndDefaultConfig.AdminMacPath,
|
||||
MacaroonPath: defaultRemoteLndMacaroonPath,
|
||||
TLSCertPath: lndDefaultConfig.TLSCertPath,
|
||||
},
|
||||
Faraday: &RemoteDaemonConfig{
|
||||
|
|
@ -526,7 +534,7 @@ func validateRemoteModeConfig(cfg *Config) error {
|
|||
// specify --network=testnet for example if everything else is using
|
||||
// the defaults.
|
||||
if cfg.Network != defaultNetwork &&
|
||||
r.Lnd.MacaroonPath == defaultLndCfg.AdminMacPath {
|
||||
r.Lnd.MacaroonPath == defaultRemoteLndMacaroonPath {
|
||||
|
||||
r.Lnd.MacaroonPath = filepath.Join(
|
||||
defaultLndCfg.DataDir, defaultLndChainSubDir,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue