Merge pull request #4667 from guggero/auto-compact
channeldb/kvdb/bolt: automatically compact database on startup
This commit is contained in:
21 files changed
+659
-94
No files matched your search
@@ -10,7 +10,6 @@ import (
|
||||
"math/big"
|
||||
prand "math/rand"
|
||||
"net"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -372,10 +371,10 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
// Initialize the sphinx router, placing it's persistent replay log in
|
||||
// the same directory as the channel graph database. We don't need to
|
||||
// replicate this data, so we'll store it locally.
|
||||
sharedSecretPath := filepath.Join(
|
||||
cfg.localDatabaseDir(), defaultSphinxDbName,
|
||||
replayLog := htlcswitch.NewDecayedLog(
|
||||
cfg.localDatabaseDir(), defaultSphinxDbName, cfg.DB.Bolt,
|
||||
cc.ChainNotifier,
|
||||
)
|
||||
replayLog := htlcswitch.NewDecayedLog(sharedSecretPath, cc.ChainNotifier)
|
||||
sphinxRouter := sphinx.NewRouter(
|
||||
nodeKeyECDH, cfg.ActiveNetParams.Params, replayLog,
|
||||
)
|
||||
@@ -1303,7 +1302,9 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
diskCheck := healthcheck.NewObservation(
|
||||
"disk space",
|
||||
func() error {
|
||||
free, err := healthcheck.AvailableDiskSpace(cfg.LndDir)
|
||||
free, err := healthcheck.AvailableDiskSpaceRatio(
|
||||
cfg.LndDir,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user