mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 13:42:49 +02:00
build: Append commit hash to the main LND context
It can be disabled via the new `logging.no-commit-hash` config option.
This commit is contained in:
13
lnd.go
13
lnd.go
@@ -155,6 +155,15 @@ func Main(cfg *Config, lisCfg ListenerCfg, implCfg *ImplementationCfg,
|
||||
}
|
||||
}()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
ctx, err := build.WithBuildInfo(ctx, cfg.LogConfig)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to add build info to context: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
mkErr := func(format string, args ...interface{}) error {
|
||||
ltndLog.Errorf("Shutting down because error in main "+
|
||||
"method: "+format, args...)
|
||||
@@ -188,10 +197,6 @@ func Main(cfg *Config, lisCfg ListenerCfg, implCfg *ImplementationCfg,
|
||||
strings.Title(BitcoinChainName), network,
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
// Enable http profiling server if requested.
|
||||
if cfg.Pprof.Profile != "" {
|
||||
// Create the http handler.
|
||||
|
Reference in New Issue
Block a user