multi: add new NoRevLogAmtData config option

In this commit, a new `--db.no-rev-log-amt-data` flag is added. The
config option is passed though to everywhere that it will be used. Note
that it is still a no-op in this commit. An upcoming commit will make
use of the flag.
This commit is contained in:
Elle Mouton committed 2023-02-16 20:47:29 +02:00
1 parent 9c01916bc0
commit 0730337cc7
11 files changed
+55 -12

No files matched your search

+8 -1
View File
@@ -324,6 +324,10 @@ type DB struct {
dryRun bool
keepFailedPaymentAttempts bool
storeFinalHtlcResolutions bool
// noRevLogAmtData if true, means that commitment transaction amount
// data should not be stored in the revocation log.
noRevLogAmtData bool
}
// Open opens or creates channeldb. Any necessary schemas migrations due
@@ -382,6 +386,7 @@ func CreateWithBackend(backend kvdb.Backend,
dryRun: opts.dryRun,
keepFailedPaymentAttempts: opts.keepFailedPaymentAttempts,
storeFinalHtlcResolutions: opts.storeFinalHtlcResolutions,
noRevLogAmtData: opts.NoRevLogAmtData,
}
// Set the parent pointer (only used in tests).
@@ -1562,7 +1567,9 @@ func (d *DB) applyOptionalVersions(cfg OptionalMiragtionConfig) error {
log.Infof("Performing database optional migration: %s", version.name)
migrationCfg := &MigrationConfigImpl{
migration30.MigrateRevLogConfigImpl{},
migration30.MigrateRevLogConfigImpl{
NoAmountData: d.noRevLogAmtData,
},
}
// Migrate the data.