diff --git a/src/util/system.cpp b/src/util/system.cpp --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -456,6 +456,15 @@ SaveErrors(read_errors, errors); return false; } + for (const auto &setting : m_settings.rw_settings) { + std::string section; + std::string key = setting.first; + // Split setting key into section and argname + (void)InterpretOption(section, key, /* value */ {}); + if (!GetArgFlags('-' + key)) { + LogPrintf("Ignoring unknown rw_settings value %s\n", setting.first); + } + } return true; } diff --git a/test/functional/feature_settings.py b/test/functional/feature_settings.py --- a/test/functional/feature_settings.py +++ b/test/functional/feature_settings.py @@ -33,20 +33,26 @@ json.dump({"string": "string", "num": 5, "bool": True, "null": None, "list": [6, 7]}, fp) with node.assert_debug_log(expected_msgs=[ + 'Ignoring unknown rw_settings value bool', + 'Ignoring unknown rw_settings value list', + 'Ignoring unknown rw_settings value null', + 'Ignoring unknown rw_settings value num', + 'Ignoring unknown rw_settings value string', 'Setting file arg: string = "string"', 'Setting file arg: num = 5', 'Setting file arg: bool = true', 'Setting file arg: null = null', - 'Setting file arg: list = [6,7]']): + 'Setting file arg: list = [6,7]', + ]): self.start_node(0) self.stop_node(0) # Assert settings are unchanged after shutdown with settings.open() as fp: assert_equal( - json.load(fp), { - "string": "string", "num": 5, "bool": True, "null": None, "list": [ - 6, 7]}) + json.load(fp), + {"string": "string", "num": 5, "bool": True, "null": None, + "list": [6, 7]}) # Test invalid json with settings.open("w") as fp: