multi: add keep-failed-payment-attempts flag
This commit is contained in:
1 parent
e6277986fd
commit
8291e8a170
7 files changed
+72
-34
No files matched your search
+8
-6
@@ -247,10 +247,11 @@ type DB struct {
|
||||
// channelStateDB separates all DB operations on channel state.
|
||||
channelStateDB *ChannelStateDB
|
||||
|
||||
dbPath string
|
||||
graph *ChannelGraph
|
||||
clock clock.Clock
|
||||
dryRun bool
|
||||
dbPath string
|
||||
graph *ChannelGraph
|
||||
clock clock.Clock
|
||||
dryRun bool
|
||||
keepFailedPaymentAttempts bool
|
||||
}
|
||||
|
||||
// Open opens or creates channeldb. Any necessary schemas migrations due
|
||||
@@ -303,8 +304,9 @@ func CreateWithBackend(backend kvdb.Backend, modifiers ...OptionModifier) (*DB,
|
||||
},
|
||||
backend: backend,
|
||||
},
|
||||
clock: opts.clock,
|
||||
dryRun: opts.dryRun,
|
||||
clock: opts.clock,
|
||||
dryRun: opts.dryRun,
|
||||
keepFailedPaymentAttempts: opts.keepFailedPaymentAttempts,
|
||||
}
|
||||
|
||||
// Set the parent pointer (only used in tests).
|
||||
|
||||
@@ -61,6 +61,10 @@ type Options struct {
|
||||
// dryRun will fail to commit a successful migration when opening the
|
||||
// database if set to true.
|
||||
dryRun bool
|
||||
|
||||
// keepFailedPaymentAttempts determines whether failed htlc attempts
|
||||
// are kept on disk or removed to save space.
|
||||
keepFailedPaymentAttempts bool
|
||||
}
|
||||
|
||||
// DefaultOptions returns an Options populated with default values.
|
||||
@@ -164,3 +168,11 @@ func OptionDryRunMigration(dryRun bool) OptionModifier {
|
||||
o.dryRun = dryRun
|
||||
}
|
||||
}
|
||||
|
||||
// OptionKeepFailedPaymentAttempts controls whether failed payment attempts are
|
||||
// kept on disk after a payment settles.
|
||||
func OptionKeepFailedPaymentAttempts(keepFailedPaymentAttempts bool) OptionModifier {
|
||||
return func(o *Options) {
|
||||
o.keepFailedPaymentAttempts = keepFailedPaymentAttempts
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user