Skip to content

Commit e2e37cf

Browse files
committed
Remove includeconf nested scope
Easier to review ignoring whitespace Suggestion from John Newbery <[email protected]> in bitcoin#15934 (comment)
1 parent 5a84aa8 commit e2e37cf

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/util/system.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -939,15 +939,13 @@ bool ArgsManager::ReadConfigFiles(std::string& error, bool ignore_invalid_keys)
939939

940940
// Warn about recursive -includeconf
941941
conf_file_names = GetArgs("-includeconf");
942-
{
943-
std::vector<std::string> includeconf_net(GetArgs(std::string("-") + chain_id + ".includeconf"));
942+
std::vector<std::string> includeconf_net(GetArgs(std::string("-") + chain_id + ".includeconf"));
943+
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
944+
std::string chain_id_final = GetChainName();
945+
if (chain_id_final != chain_id) {
946+
// Also warn about recursive includeconf for the chain that was specified in one of the includeconfs
947+
includeconf_net = GetArgs(std::string("-") + chain_id_final + ".includeconf");
944948
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
945-
std::string chain_id_final = GetChainName();
946-
if (chain_id_final != chain_id) {
947-
// Also warn about recursive includeconf for the chain that was specified in one of the includeconfs
948-
includeconf_net = GetArgs(std::string("-") + chain_id_final + ".includeconf");
949-
conf_file_names.insert(conf_file_names.end(), includeconf_net.begin(), includeconf_net.end());
950-
}
951949
}
952950
for (const std::string& conf_file_name : conf_file_names) {
953951
tfm::format(std::cerr, "warning: -includeconf cannot be used from included files; ignoring -includeconf=%s\n", conf_file_name);

0 commit comments

Comments
 (0)