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:
1 file changed
+6
-6
@@ -102,14 +102,12 @@ func loadConfig() (*config, error) {
|
|||||||
RPCPort: defaultRPCPort,
|
RPCPort: defaultRPCPort,
|
||||||
MaxPendingChannels: defaultMaxPendingChannels,
|
MaxPendingChannels: defaultMaxPendingChannels,
|
||||||
Bitcoin: &chainConfig{
|
Bitcoin: &chainConfig{
|
||||||
RPCHost: defaultRPCHost,
|
RPCHost: defaultRPCHost,
|
||||||
ChainDir: filepath.Join(defaultDataDir, bitcoinChain.String()),
|
RPCCert: defaultBtcdRPCCertFile,
|
||||||
RPCCert: defaultBtcdRPCCertFile,
|
|
||||||
},
|
},
|
||||||
Litecoin: &chainConfig{
|
Litecoin: &chainConfig{
|
||||||
RPCHost: defaultRPCHost,
|
RPCHost: defaultRPCHost,
|
||||||
ChainDir: filepath.Join(defaultDataDir, litecoinChain.String()),
|
RPCCert: defaultLtcdRPCCertFile,
|
||||||
RPCCert: defaultLtcdRPCCertFile,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +188,7 @@ func loadConfig() (*config, error) {
|
|||||||
"ltcd: %v", err)
|
"ltcd: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
cfg.Litecoin.ChainDir = filepath.Join(cfg.DataDir, litecoinChain.String())
|
||||||
|
|
||||||
// Finally we'll register the litecoin chain as our current
|
// Finally we'll register the litecoin chain as our current
|
||||||
// primary chain.
|
// primary chain.
|
||||||
@@ -222,6 +221,7 @@ func loadConfig() (*config, error) {
|
|||||||
"btcd: %v", err)
|
"btcd: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
cfg.Bitcoin.ChainDir = filepath.Join(cfg.DataDir, bitcoinChain.String())
|
||||||
|
|
||||||
// Finally we'll register the bitcoin chain as our current
|
// Finally we'll register the bitcoin chain as our current
|
||||||
// primary chain.
|
// primary chain.
|
||||||
|
|||||||
Reference in new issue
Block a user