mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists.
Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exists. This commit changes the logic to only display this message if a config file exists and logs a separate message if no config file exists. Additionally, a warning is now logged if the file path passed in the -conf flag does not exist.
This commit is contained in:
parent
07033a8f91
commit
946107a68f
14
src/init.cpp
14
src/init.cpp
@ -1243,7 +1243,19 @@ bool AppInitMain()
|
||||
LogPrintf("Startup time: %s\n", FormatISO8601DateTime(GetTime()));
|
||||
LogPrintf("Default data directory %s\n", GetDefaultDataDir().string());
|
||||
LogPrintf("Using data directory %s\n", GetDataDir().string());
|
||||
LogPrintf("Using config file %s\n", GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)).string());
|
||||
|
||||
// Only log conf file usage message if conf file actually exists.
|
||||
fs::path config_file_path = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
|
||||
if (fs::exists(config_file_path)) {
|
||||
LogPrintf("Config file: %s\n", config_file_path.string());
|
||||
} else if (gArgs.IsArgSet("-conf")) {
|
||||
// Warn if no conf file exists at path provided by user
|
||||
InitWarning(strprintf(_("The specified config file %s does not exist\n"), config_file_path.string()));
|
||||
} else {
|
||||
// Not categorizing as "Warning" because it's the default behavior
|
||||
LogPrintf("Config file: %s (not found, skipping)\n", config_file_path.string());
|
||||
}
|
||||
|
||||
LogPrintf("Using at most %i automatic connections (%i file descriptors available)\n", nMaxConnections, nFD);
|
||||
|
||||
// Warn about relative -datadir path.
|
||||
|
Loading…
Reference in New Issue
Block a user