v31.1-roots.1 · Commit 7: [PATCH 07/17] feat(rpc): preserve Roots operator interfaces on v31
src/common/settings.cpp
Before: src/common/settings.cpp · After: src/common/settings.cpp
File metadata
index 7d511b574dea23f68ed029e1be1186c341790b65..288ef894aba0b0d10c4158976aecd2e51308de71 100644
Download original patch · Release notes
Diff rows 1–33 of 33. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/common/settings.cpp
CHANGED
|
@@ -24,6 +24,7 @@ namespace {
|
|
| 24 |
enum class Source {
|
| 25 |
FORCED,
|
| 26 |
COMMAND_LINE,
|
|
|
|
| 27 |
RW_SETTINGS,
|
| 28 |
CONFIG_FILE_NETWORK_SECTION,
|
| 29 |
CONFIG_FILE_DEFAULT_SECTION
|
|
@@ -48,6 +49,10 @@ static void MergeSettings(const Settings& settings, const std::string& section,
|
|
| 48 |
if (auto* values = FindKey(settings.command_line_options, name)) {
|
| 49 |
fn(SettingsSpan(*values), Source::COMMAND_LINE);
|
| 50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
// Merge in the read-write settings
|
| 52 |
if (const SettingsValue* value = FindKey(settings.rw_settings, name)) {
|
| 53 |
fn(SettingsSpan(*value), Source::RW_SETTINGS);
|
|
@@ -173,7 +178,7 @@ SettingsValue GetSetting(const Settings& settings,
|
|
| 173 |
// the config file the precedence is reversed for all settings except
|
| 174 |
// chain type settings.
|
| 175 |
const bool reverse_precedence =
|
| 176 |
-
(source == Source::CONFIG_FILE_NETWORK_SECTION || source == Source::CONFIG_FILE_DEFAULT_SECTION) &&
|
| 177 |
!get_chain_type;
|
| 178 |
|
| 179 |
// Weird behavior preserved for backwards compatibility: Negated
|
|
@@ -225,7 +230,7 @@ std::vector<SettingsValue> GetSettingsList(const Settings& settings,
|
|
| 225 |
// settings will be brought back from the dead (but earlier command
|
| 226 |
// line settings will still be ignored).
|
| 227 |
const bool add_zombie_config_values =
|
| 228 |
-
(source == Source::CONFIG_FILE_NETWORK_SECTION || source == Source::CONFIG_FILE_DEFAULT_SECTION) &&
|
| 229 |
!prev_negated_empty;
|
| 230 |
|
| 231 |
// Ignore settings in default config section if requested.
|
|
|
|
| 24 |
enum class Source {
|
| 25 |
FORCED,
|
| 26 |
COMMAND_LINE,
|
| 27 |
+
CONFIG_FILE_RW,
|
| 28 |
RW_SETTINGS,
|
| 29 |
CONFIG_FILE_NETWORK_SECTION,
|
| 30 |
CONFIG_FILE_DEFAULT_SECTION
|
|
|
|
| 49 |
if (auto* values = FindKey(settings.command_line_options, name)) {
|
| 50 |
fn(SettingsSpan(*values), Source::COMMAND_LINE);
|
| 51 |
}
|
| 52 |
+
// Merge in the rw config file
|
| 53 |
+
if (auto* values = FindKey(settings.rw_config, name)) {
|
| 54 |
+
fn(SettingsSpan(*values), Source::CONFIG_FILE_RW);
|
| 55 |
+
}
|
| 56 |
// Merge in the read-write settings
|
| 57 |
if (const SettingsValue* value = FindKey(settings.rw_settings, name)) {
|
| 58 |
fn(SettingsSpan(*value), Source::RW_SETTINGS);
|
|
|
|
| 178 |
// the config file the precedence is reversed for all settings except
|
| 179 |
// chain type settings.
|
| 180 |
const bool reverse_precedence =
|
| 181 |
+
(source == Source::CONFIG_FILE_RW || source == Source::CONFIG_FILE_NETWORK_SECTION || source == Source::CONFIG_FILE_DEFAULT_SECTION) &&
|
| 182 |
!get_chain_type;
|
| 183 |
|
| 184 |
// Weird behavior preserved for backwards compatibility: Negated
|
|
|
|
| 230 |
// settings will be brought back from the dead (but earlier command
|
| 231 |
// line settings will still be ignored).
|
| 232 |
const bool add_zombie_config_values =
|
| 233 |
+
(source == Source::CONFIG_FILE_RW || source == Source::CONFIG_FILE_NETWORK_SECTION || source == Source::CONFIG_FILE_DEFAULT_SECTION) &&
|
| 234 |
!prev_negated_empty;
|
| 235 |
|
| 236 |
// Ignore settings in default config section if requested.
|