mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
config: set chain directory _after_ the command line+config has been parsed
This commit fixes a bug introduced by the new multi-chain features of and which disallowed multiple nodes from beings started locally. Previously if two local nodes were set to, the _same_ chain, then they’d both share the same chain data directory which would prevent one of the nodes from being able to start up properly.
This commit is contained in:
parent
6acd177c33
commit
b89a39d341
12
config.go
12
config.go
@ -102,14 +102,12 @@ func loadConfig() (*config, error) {
|
||||
RPCPort: defaultRPCPort,
|
||||
MaxPendingChannels: defaultMaxPendingChannels,
|
||||
Bitcoin: &chainConfig{
|
||||
RPCHost: defaultRPCHost,
|
||||
ChainDir: filepath.Join(defaultDataDir, bitcoinChain.String()),
|
||||
RPCCert: defaultBtcdRPCCertFile,
|
||||
RPCHost: defaultRPCHost,
|
||||
RPCCert: defaultBtcdRPCCertFile,
|
||||
},
|
||||
Litecoin: &chainConfig{
|
||||
RPCHost: defaultRPCHost,
|
||||
ChainDir: filepath.Join(defaultDataDir, litecoinChain.String()),
|
||||
RPCCert: defaultLtcdRPCCertFile,
|
||||
RPCHost: defaultRPCHost,
|
||||
RPCCert: defaultLtcdRPCCertFile,
|
||||
},
|
||||
}
|
||||
|
||||
@ -190,6 +188,7 @@ func loadConfig() (*config, error) {
|
||||
"ltcd: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
cfg.Litecoin.ChainDir = filepath.Join(cfg.DataDir, litecoinChain.String())
|
||||
|
||||
// Finally we'll register the litecoin chain as our current
|
||||
// primary chain.
|
||||
@ -222,6 +221,7 @@ func loadConfig() (*config, error) {
|
||||
"btcd: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
cfg.Bitcoin.ChainDir = filepath.Join(cfg.DataDir, bitcoinChain.String())
|
||||
|
||||
// Finally we'll register the bitcoin chain as our current
|
||||
// primary chain.
|
||||
|
Loading…
Reference in New Issue
Block a user