mirror of
https://github.com/lightninglabs/faraday.git
synced 2026-08-13 12:33:35 +02:00
config: fix parsing of FaradayDir config option
Set the `faradayDirSet` boolean before namespacing the directory with the network. This fixes a bug where the user would _not_ set faradayDir but would set the macaroon path and would run into the "faradaydir overwrites macaroonpath..." error.
This commit is contained in:
parent
8e6b4b5dcb
commit
bd3736d6e2
1 changed files with 4 additions and 1 deletions
|
|
@ -192,6 +192,10 @@ func ValidateConfig(config *Config) error {
|
|||
config.TLSKeyPath = lncfg.CleanAndExpandPath(config.TLSKeyPath)
|
||||
config.MacaroonPath = lncfg.CleanAndExpandPath(config.MacaroonPath)
|
||||
|
||||
// Before adding the network namespace below, check if the user has
|
||||
// overwritten the default faraday directory.
|
||||
faradayDirSet := config.FaradayDir != FaradayDirBase
|
||||
|
||||
// Append the network type to faraday directory so they are "namespaced"
|
||||
// per network.
|
||||
config.FaradayDir = filepath.Join(config.FaradayDir, config.Network)
|
||||
|
|
@ -205,7 +209,6 @@ func ValidateConfig(config *Config) error {
|
|||
// values, make sure that they are not set when faraday dir is set. We
|
||||
// fail hard here rather than overwriting and potentially confusing the
|
||||
// user.
|
||||
faradayDirSet := config.FaradayDir != FaradayDirBase
|
||||
if faradayDirSet {
|
||||
tlsCertPathSet := config.TLSCertPath != DefaultTLSCertPath
|
||||
tlsKeyPathSet := config.TLSKeyPath != DefaultTLSKeyPath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue