Skip to content

Commit

Permalink
lnd: fix regression in DB open time logs
Browse files Browse the repository at this point in the history
In this commit, we fix a regression in our DB open time logging that was
introduced in lightningnetwork#4015. Obtaining the target backend from the configuration
will actually also open the database, so we need to include that in the time
delta as well.
  • Loading branch information
Roasbeef authored and matheusd committed Oct 12, 2020
1 parent f052236 commit a0225ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ func Main(cfg *Config, lisCfg ListenerCfg, shutdownChan <-chan struct{}) error {
ltndLog.Infof("Opening the main database, this might take a few " +
"minutes...")

startOpenTime := time.Now()
chanDbBackend, err := cfg.DB.GetBackend(
cfg.localDatabaseDir(), cfg.networkName(),
)
Expand All @@ -264,7 +265,6 @@ func Main(cfg *Config, lisCfg ListenerCfg, shutdownChan <-chan struct{}) error {

// Open the channeldb, which is dedicated to storing channel, and
// network related metadata.
startOpenTime := time.Now()
chanDB, err := channeldb.CreateWithBackend(
chanDbBackend,
channeldb.OptionSetRejectCacheSize(cfg.Caches.RejectCacheSize),
Expand Down

0 comments on commit a0225ff

Please sign in to comment.