Skip to content

Commit c8042a4

Browse files
committed
Remove arguments to ParseConfigFile
1 parent 0f921e6 commit c8042a4

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int AppInitRPC(int argc, char* argv[])
9999
return EXIT_FAILURE;
100100
}
101101
try {
102-
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs);
102+
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
103103
} catch (const std::exception& e) {
104104
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
105105
return EXIT_FAILURE;

src/bitcoind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool AppInit(int argc, char* argv[])
104104
}
105105
try
106106
{
107-
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs);
107+
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
108108
} catch (const std::exception& e) {
109109
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
110110
return false;

src/qt/bitcoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ int main(int argc, char *argv[])
608608
return EXIT_FAILURE;
609609
}
610610
try {
611-
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs);
611+
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
612612
} catch (const std::exception& e) {
613613
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
614614
QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what()));

src/util.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,7 @@ boost::filesystem::path GetConfigFile(const std::string& confPath)
526526
return pathConfigFile;
527527
}
528528

529-
void ReadConfigFile(const std::string& confPath,
530-
map<string, string>& mapSettingsRet,
531-
map<string, vector<string> >& mapMultiSettingsRet)
529+
void ReadConfigFile(const std::string& confPath)
532530
{
533531
boost::filesystem::ifstream streamConfig(GetConfigFile(confPath));
534532
if (!streamConfig.good())
@@ -543,9 +541,9 @@ void ReadConfigFile(const std::string& confPath,
543541
string strKey = string("-") + it->string_key;
544542
string strValue = it->value[0];
545543
InterpretNegativeSetting(strKey, strValue);
546-
if (mapSettingsRet.count(strKey) == 0)
547-
mapSettingsRet[strKey] = strValue;
548-
mapMultiSettingsRet[strKey].push_back(strValue);
544+
if (mapArgs.count(strKey) == 0)
545+
mapArgs[strKey] = strValue;
546+
mapMultiArgs[strKey].push_back(strValue);
549547
}
550548
// If datadir is changed in .conf file:
551549
ClearDatadirCache();

src/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ boost::filesystem::path GetConfigFile(const std::string& confPath);
106106
boost::filesystem::path GetPidFile();
107107
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
108108
#endif
109-
void ReadConfigFile(const std::string& confPath, std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
109+
void ReadConfigFile(const std::string& confPath);
110110
#ifdef WIN32
111111
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
112112
#endif

0 commit comments

Comments
 (0)