mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-29 12:03:43 +02:00
paymentsdb: rename defaultKVStoreOptions func
We rename the modifier to use the same naming as used in the graphDB to align the codebase.
This commit is contained in:
@@ -133,18 +133,11 @@ type KVStore struct {
|
|||||||
keepFailedPaymentAttempts bool
|
keepFailedPaymentAttempts bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// defaultKVStoreOptions returns the default options for the KV store.
|
|
||||||
func defaultKVStoreOptions() *StoreOptions {
|
|
||||||
return &StoreOptions{
|
|
||||||
KeepFailedPaymentAttempts: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewKVStore creates a new KVStore for payments.
|
// NewKVStore creates a new KVStore for payments.
|
||||||
func NewKVStore(db kvdb.Backend,
|
func NewKVStore(db kvdb.Backend,
|
||||||
options ...OptionModifier) (*KVStore, error) {
|
options ...OptionModifier) (*KVStore, error) {
|
||||||
|
|
||||||
opts := defaultKVStoreOptions()
|
opts := DefaultOptions()
|
||||||
for _, applyOption := range options {
|
for _, applyOption := range options {
|
||||||
applyOption(opts)
|
applyOption(opts)
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,14 @@ type StoreOptions struct {
|
|||||||
KeepFailedPaymentAttempts bool
|
KeepFailedPaymentAttempts bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DefaultOptions returns a StoreOptions populated with default values.
|
||||||
|
func DefaultOptions() *StoreOptions {
|
||||||
|
return &StoreOptions{
|
||||||
|
KeepFailedPaymentAttempts: false,
|
||||||
|
NoMigration: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// OptionModifier is a function signature for modifying the default
|
// OptionModifier is a function signature for modifying the default
|
||||||
// StoreOptions.
|
// StoreOptions.
|
||||||
type OptionModifier func(*StoreOptions)
|
type OptionModifier func(*StoreOptions)
|
||||||
|
Reference in New Issue
Block a user