Skip to content

Commit 728a262

Browse files
committed
config: fix default macaroon paths
We used the wrong constants for the default values of lnd's macaroon paths. This commit sets the correct default values before the config is parsed.
1 parent e835163 commit 728a262

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

config.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,18 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
395395
// (like the log or lnd options) as they will be taken from lnd's config
396396
// struct. Others we want to force to be the same as lnd so the user
397397
// doesn't have to set them manually, like the network for example.
398+
cfg.Faraday.Lnd.MacaroonPath = faraday.DefaultLndMacaroonPath
398399
if err := faraday.ValidateConfig(cfg.Faraday); err != nil {
399400
return nil, err
400401
}
401-
cfg.Loop.Lnd.MacaroonPath = loopd.DefaultMacaroonPath
402+
403+
defaultLoopCfg := loopd.DefaultConfig()
404+
cfg.Loop.Lnd.MacaroonPath = defaultLoopCfg.Lnd.MacaroonPath
402405
if err := loopd.Validate(cfg.Loop); err != nil {
403406
return nil, err
404407
}
405-
cfg.Pool.Lnd.MacaroonPath = pool.DefaultMacaroonPath
408+
409+
cfg.Pool.Lnd.MacaroonPath = pool.DefaultLndMacaroonPath
406410
if err := pool.Validate(cfg.Pool); err != nil {
407411
return nil, err
408412
}
@@ -436,7 +440,6 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
436440
}
437441
}
438442

439-
defaultLoopCfg := loopd.DefaultConfig()
440443
if cfg.loopRemote && cfg.Network != defaultNetwork {
441444
if cfg.Remote.Loop.MacaroonPath == defaultLoopCfg.MacaroonPath {
442445
cfg.Remote.Loop.MacaroonPath = cfg.Loop.MacaroonPath

0 commit comments

Comments
 (0)