config: fix macaroon path construction

Fix the macaroon path construction so that even if the network is not
mainnet, the path gets constructed correctly from a user specified
"--lit.dir" flag.
This commit is contained in:
Elle Mouton 2023-07-17 10:53:22 +02:00
parent ba78616eb9
commit c2e34d7138
No known key found for this signature in database
GPG key ID: D7D916376026F177

View file

@ -440,12 +440,10 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
}
}
if cfg.Network != DefaultNetwork {
if cfg.MacaroonPath == DefaultMacaroonPath {
cfg.MacaroonPath = filepath.Join(
litDir, cfg.Network, DefaultMacaroonFilename,
)
}
if cfg.MacaroonPath == DefaultMacaroonPath {
cfg.MacaroonPath = filepath.Join(
litDir, cfg.Network, DefaultMacaroonFilename,
)
}
// Initiate our listeners. For now, we only support listening on one