Skip to content

Commit

Permalink
Remove includeconf nested scope
Browse files Browse the repository at this point in the history
Easier to review ignoring whitespace

Suggestion from John Newbery <john@johnnewbery.com> in
bitcoin/bitcoin#15934 (comment)
  • Loading branch information
ryanofsky committed Nov 8, 2019
1 parent 5a84aa8 commit e2e37cf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/util/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,15 +939,13 @@ bool ArgsManager::ReadConfigFiles(std::string& error, bool ignore_invalid_keys)

// Warn about recursive -includeconf
conf_file_names = GetArgs("-includeconf");
{
std::vector<std::string> includeconf_net(GetArgs(std::string("-") + chain_id + ".includeconf"));
std::vector<std::string> includeconf_net(GetArgs(std::string("-") + chain_id + ".includeconf"));
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
std::string chain_id_final = GetChainName();
if (chain_id_final != chain_id) {
// Also warn about recursive includeconf for the chain that was specified in one of the includeconfs
includeconf_net = GetArgs(std::string("-") + chain_id_final + ".includeconf");
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
std::string chain_id_final = GetChainName();
if (chain_id_final != chain_id) {
// Also warn about recursive includeconf for the chain that was specified in one of the includeconfs
includeconf_net = GetArgs(std::string("-") + chain_id_final + ".includeconf");
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
}
}
for (const std::string& conf_file_name : conf_file_names) {
tfm::format(std::cerr, "warning: -includeconf cannot be used from included files; ignoring -includeconf=%s\n", conf_file_name);
Expand Down

0 comments on commit e2e37cf

Please sign in to comment.