channeldb: final htlc resolution storage opt-in

This commit is contained in:
Joost Jager committed 2023-01-26 07:02:17 +01:00
1 parent b50d59ec2e
commit 7a785c74c4
10 files changed
+85 -27

No files matched your search

+14
View File
@@ -74,6 +74,10 @@ type Options struct {
// keepFailedPaymentAttempts determines whether failed htlc attempts
// are kept on disk or removed to save space.
keepFailedPaymentAttempts bool
// storeFinalHtlcResolutions determines whether to persistently store
// the final resolution of incoming htlcs.
storeFinalHtlcResolutions bool
}
// DefaultOptions returns an Options populated with default values.
@@ -187,6 +191,16 @@ func OptionKeepFailedPaymentAttempts(keepFailedPaymentAttempts bool) OptionModif
}
}
// OptionStoreFinalHtlcResolutions controls whether to persistently store the
// final resolution of incoming htlcs.
func OptionStoreFinalHtlcResolutions(
storeFinalHtlcResolutions bool) OptionModifier {
return func(o *Options) {
o.storeFinalHtlcResolutions = storeFinalHtlcResolutions
}
}
// OptionPruneRevocationLog specifies whether the migration for pruning
// revocation logs needs to be applied or not.
func OptionPruneRevocationLog(prune bool) OptionModifier {