multi: refactor external subserver config

As a preparation for making more and more implementation details
configurable, we add a new ImplementationCfg struct that houses all the
interfaces that can be defined externally.
This commit is contained in:
Oliver Gugger
2021-09-23 16:54:39 +02:00
parent 140d5a8086
commit 0e279eb15a
6 changed files with 165 additions and 113 deletions

View File

@@ -99,6 +99,7 @@ func Start(extraArgs string, rpcReady Callback) {
Ready: rpcListening,
}},
}
implCfg := loadedConfig.ImplementationConfig()
// Call the "real" main in a nested manner so the defers will properly
// be executed in the case of a graceful shutdown.
@@ -107,7 +108,7 @@ func Start(extraArgs string, rpcReady Callback) {
defer close(quit)
if err := lnd.Main(
loadedConfig, cfg, shutdownInterceptor,
loadedConfig, cfg, implCfg, shutdownInterceptor,
); err != nil {
if e, ok := err.(*flags.Error); ok &&
e.Type == flags.ErrHelp {