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 committed May 22, 2020
1 parent 7f1a450 commit bbc4f06
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 @@ -250,6 +250,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 @@ -260,7 +261,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 bbc4f06

Please sign in to comment.