34 const fs::path orig_datadir_path{
args.GetDataDirBase()};
38 if (!
args.ReadConfigFiles(error,
true)) {
46 const auto base_path{
args.GetDataDirBase()};
47 if (!fs::exists(base_path)) {
58 fs::create_directories(base_path /
"wallets");
60 const auto net_path{
args.GetDataDirNet()};
61 if (!fs::exists(net_path)) {
62 fs::create_directories(net_path /
"wallets");
68 if (fs::exists(base_config_path)) {
69 if (orig_config_path.empty()) {
71 "Data directory %s contains a %s file which is explicitly ignored using -noconf.",
72 fs::quoted(fs::PathToString(base_path)),
74 }
else if (!fs::equivalent(orig_config_path, base_config_path)) {
75 const std::string cli_config_path =
args.GetArg(
"-conf",
"");
76 const std::string config_source = cli_config_path.empty()
77 ?
strprintf(
"data directory %s", fs::quoted(fs::PathToString(orig_datadir_path)))
78 :
strprintf(
"command line argument %s", fs::quoted(
"-conf=" + cli_config_path));
80 "Data directory %1$s contains a %2$s file which is ignored, because a different configuration file "
81 "%3$s from %4$s is being used instead. Possible ways to address this would be to:\n"
82 "- Delete or rename the %2$s file in data directory %1$s.\n"
83 "- Change datadir= or conf= options to specify one configuration file, not two, and use "
84 "includeconf= to include any other configuration files.",
85 fs::quoted(fs::PathToString(base_path)),
87 fs::quoted(fs::PathToString(orig_config_path)),
89 if (
args.GetBoolArg(
"-allowignoredconf",
false)) {
92 error +=
"\n- Set allowignoredconf=1 option to treat this condition as a warning, not an error.";
99 if (
args.GetSettingsPath()) {
100 std::vector<std::string> details;
101 if (!
args.ReadSettingsFile(&details)) {
102 const bilingual_str& message =
_(
"Settings file could not be read");
103 if (!settings_abort_fn) {
105 }
else if (settings_abort_fn(message, details)) {
111 if (!
args.WriteSettingsFile(&details)) {
112 const bilingual_str& message =
_(
"Settings file could not be written");
116 }
catch (
const std::exception& e) {