mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 18:27:43 +02:00
mulit: use kvdb.Backend for the kv payment db
Instead of the ChannelState struct we now use the kv backend interface for the payment kv database.
This commit is contained in:
30
payments/db/options.go
Normal file
30
payments/db/options.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package paymentsdb
|
||||
|
||||
// StoreOptions holds parameters for the KVStore.
|
||||
type StoreOptions struct {
|
||||
// NoMigration allows to open the database in readonly mode
|
||||
NoMigration bool
|
||||
|
||||
// KeepFailedPaymentAttempts is a flag that determines whether to keep
|
||||
// failed payment attempts for a settled payment in the db.
|
||||
KeepFailedPaymentAttempts bool
|
||||
}
|
||||
|
||||
// OptionModifier is a function signature for modifying the default
|
||||
// StoreOptions.
|
||||
type OptionModifier func(*StoreOptions)
|
||||
|
||||
// WithKeepFailedPaymentAttempts sets the KeepFailedPaymentAttempts to n.
|
||||
func WithKeepFailedPaymentAttempts(n bool) OptionModifier {
|
||||
return func(o *StoreOptions) {
|
||||
o.KeepFailedPaymentAttempts = n
|
||||
}
|
||||
}
|
||||
|
||||
// WithNoMigration allows the database to be opened in read only mode by
|
||||
// disabling migrations.
|
||||
func WithNoMigration(b bool) OptionModifier {
|
||||
return func(o *StoreOptions) {
|
||||
o.NoMigration = b
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user