mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 22:50:58 +02:00
lnd+config: move config parsing to cmd
Now that we have access to the configuration parsing outside of the main package, we can move the actual parsing to the command line package.
This commit is contained in:
10
lnd.go
10
lnd.go
@@ -150,17 +150,11 @@ type rpcListeners func() ([]*ListenerWithSignal, func(), error)
|
||||
// Main is the true entry point for lnd. This function is required since defers
|
||||
// created in the top-level scope of a main method aren't executed if os.Exit()
|
||||
// is called.
|
||||
func Main(lisCfg ListenerCfg) error {
|
||||
func Main(config *Config, lisCfg ListenerCfg) error {
|
||||
// Hook interceptor for os signals.
|
||||
signal.Intercept()
|
||||
|
||||
// Load the configuration, and parse any command line options. This
|
||||
// function will also set up logging properly.
|
||||
loadedConfig, err := LoadConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cfg = loadedConfig
|
||||
cfg = config
|
||||
defer func() {
|
||||
ltndLog.Info("Shutdown complete")
|
||||
err := RootLogWriter.Close()
|
||||
|
Reference in New Issue
Block a user