lnd: integrate leader elector to lnd main
This commit also changes the order of DB init to be run after the RPC server is up. This will allow us to later add an RPC endpoint to be used to query leadership status.
This commit is contained in:
4 files changed
+117
-15
No files matched your search
@@ -366,6 +366,8 @@ type Config struct {
|
||||
|
||||
DB *lncfg.DB `group:"db" namespace:"db"`
|
||||
|
||||
Cluster *lncfg.Cluster `group:"cluster" namespace:"cluster"`
|
||||
|
||||
// LogWriter is the root logger that all of the daemon's subloggers are
|
||||
// hooked up to.
|
||||
LogWriter *build.RotatingLogWriter
|
||||
@@ -532,6 +534,7 @@ func DefaultConfig() Config {
|
||||
MaxCommitFeeRateAnchors: lnwallet.DefaultAnchorsCommitMaxFeeRateSatPerVByte,
|
||||
LogWriter: build.NewRotatingLogWriter(),
|
||||
DB: lncfg.DefaultDB(),
|
||||
Cluster: lncfg.DefaultCluster(),
|
||||
registeredChains: chainreg.NewChainRegistry(),
|
||||
ActiveNetParams: chainreg.BitcoinTestNetParams,
|
||||
ChannelCommitInterval: defaultChannelCommitInterval,
|
||||
@@ -1372,6 +1375,7 @@ func ValidateConfig(cfg Config, usageMessage string,
|
||||
cfg.Caches,
|
||||
cfg.WtClient,
|
||||
cfg.DB,
|
||||
cfg.Cluster,
|
||||
cfg.HealthChecks,
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user