mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
config: unify old and new config values for sync-freelist
In this commit, unify the old and new values for `sync-freelist`, and also ensure that we don't break behavior for any users that're using the _old_ value. To do this, we first rename what was `--db.bolt.no-sync-freelist`, to `--db.bolt.sync-freelist`. This gets rid of the negation on the config level, and lets us override that value if the user is specifying the legacy config option. In the future, we'll deprecate the old config option, in favor of the new DB scoped option.
This commit is contained in:
@@ -1097,6 +1097,14 @@ func ValidateConfig(cfg Config, usageMessage string) (*Config, error) {
|
||||
"minbackoff")
|
||||
}
|
||||
|
||||
// Newer versions of lnd added a new sub-config for bolt-specific
|
||||
// parameters. However we want to also allow existing users to use the
|
||||
// value on the top-level config. If the outer config value is set,
|
||||
// then we'll use that directly.
|
||||
if cfg.SyncFreelist {
|
||||
cfg.DB.Bolt.SyncFreelist = cfg.SyncFreelist
|
||||
}
|
||||
|
||||
// Validate the subconfigs for workers, caches, and the tower client.
|
||||
err = lncfg.Validate(
|
||||
cfg.Workers,
|
||||
|
Reference in New Issue
Block a user