mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
config: make sure network dir is created
The wallet and macaroon databases are the first files that are created for a new node. When initializing those databases, the parent directory is created if it does not exist. With both of the databases now potentially being remote, that code that creates the parent directory might never be executed and we need to do that manually when parsing the configuration. Otherwise we run into an error when we later try to create our default macaroons in that folder and it doesn't exist.
This commit is contained in:
parent
f7b17df452
commit
6043113857
@ -1228,6 +1228,12 @@ func ValidateConfig(cfg Config, usageMessage string,
|
||||
lncfg.NormalizeNetwork(cfg.ActiveNetParams.Name),
|
||||
)
|
||||
|
||||
// We need to make sure the default network directory exists for when we
|
||||
// try to create our default macaroons there.
|
||||
if err := makeDirectory(cfg.networkDir); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// If a custom macaroon directory wasn't specified and the data
|
||||
// directory has changed from the default path, then we'll also update
|
||||
// the path for the macaroons to be generated.
|
||||
|
Loading…
Reference in New Issue
Block a user