multi: move global networkDir to cfg

This commit is contained in:
Oliver Gugger
2020-05-14 13:40:18 +02:00
parent 85d5cdfbfd
commit d44f205e3f
3 changed files with 13 additions and 13 deletions

9
lnd.go
View File

@ -53,11 +53,6 @@ import (
var (
cfg *Config
// networkDir is the path to the directory of the currently active
// network. This path will hold the files related to each different
// network.
networkDir string
)
// WalletUnlockerAuthOptions returns a list of DialOptions that can be used to
@ -428,7 +423,7 @@ func Main(config *Config, lisCfg ListenerCfg, shutdownChan <-chan struct{}) erro
if !cfg.NoMacaroons {
// Create the macaroon authentication/authorization service.
macaroonService, err = macaroons.NewService(
networkDir, macaroons.IPLockChecker,
cfg.networkDir, macaroons.IPLockChecker,
)
if err != nil {
err := fmt.Errorf("unable to set up macaroon "+
@ -1000,7 +995,7 @@ func waitForWalletPassword(restEndpoints []net.Addr,
// deleted within it and recreated when successfully changing the
// wallet's password.
macaroonFiles := []string{
filepath.Join(networkDir, macaroons.DBFilename),
filepath.Join(cfg.networkDir, macaroons.DBFilename),
cfg.AdminMacPath, cfg.ReadMacPath, cfg.InvoiceMacPath,
}
pwService := walletunlocker.New(