MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ReadSettingsFile

Method ReadSettingsFile

src/common/args.cpp:464–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464bool ArgsManager::ReadSettingsFile(std::vector<std::string>* errors)
465{
466 fs::path path;
467 if (!GetSettingsPath(&path, /* temp= */ false)) {
468 return true; // Do nothing if settings file disabled.
469 }
470
471 LOCK(cs_args);
472 m_settings.rw_settings.clear();
473 std::vector<std::string> read_errors;
474 if (!common::ReadSettings(path, m_settings.rw_settings, read_errors)) {
475 SaveErrors(read_errors, errors);
476 return false;
477 }
478 for (const auto& setting : m_settings.rw_settings) {
479 KeyInfo key = InterpretKey(setting.first); // Split setting key into section and argname
480 if (!GetArgFlags_('-' + key.name)) {
481 LogWarning("Ignoring unknown rw_settings value %s", setting.first);
482 }
483 }
484 return true;
485}
486
487bool ArgsManager::WriteSettingsFile(std::vector<std::string>* errors, bool backup) const
488{

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.80
InitConfigFunction · 0.80

Calls 4

ReadSettingsFunction · 0.85
SaveErrorsFunction · 0.85
InterpretKeyFunction · 0.85
clearMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64