channeldb: implement compaction
This commit adds the compaction feature of the bbolt compact to our bolt backend. This will try to open the DB in read-only mode and create a compacted copy in a temporary file. Once the compaction was successful, the temporary file and the old source file are swapped atomically.
This commit is contained in:
5 files changed
+346
-11
No files matched your search
@@ -3,6 +3,7 @@ package channeldb
|
||||
import (
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
"github.com/lightningnetwork/lnd/channeldb/kvdb"
|
||||
mig "github.com/lightningnetwork/lnd/channeldb/migration"
|
||||
"github.com/lightningnetwork/lnd/channeldb/migration12"
|
||||
"github.com/lightningnetwork/lnd/channeldb/migration13"
|
||||
@@ -35,4 +36,5 @@ func UseLogger(logger btclog.Logger) {
|
||||
migration12.UseLogger(logger)
|
||||
migration13.UseLogger(logger)
|
||||
migration16.UseLogger(logger)
|
||||
kvdb.UseLogger(logger)
|
||||
}
|
||||
Reference in new issue
Block a user