Skip to content

Commit b20b34f

Browse files
committed
refactor: Use new GetConfigFilePath function
New function was introduced by willcl-ark <will@256k1.dev> in commit 56e370f from bitcoin/bitcoin#27073 and removes some duplicate code.
1 parent 6758bd7 commit b20b34f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
817817
if (failedToGetAuthCookie) {
818818
throw std::runtime_error(strprintf(
819819
"Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (%s)",
820-
fs::PathToString(GetConfigFile(gArgs.GetPathArg("-conf", BITCOIN_CONF_FILENAME)))));
820+
fs::PathToString(gArgs.GetConfigFilePath())));
821821
} else {
822822
throw std::runtime_error("Authorization failed: Incorrect rpcuser or rpcpassword");
823823
}

src/init/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ bool StartLogging(const ArgsManager& args)
121121
LogPrintf("Using data directory %s\n", fs::PathToString(gArgs.GetDataDirNet()));
122122

123123
// Only log conf file usage message if conf file actually exists.
124-
fs::path config_file_path = GetConfigFile(args.GetPathArg("-conf", BITCOIN_CONF_FILENAME));
124+
fs::path config_file_path = args.GetConfigFilePath();
125125
if (fs::exists(config_file_path)) {
126126
LogPrintf("Config file: %s\n", fs::PathToString(config_file_path));
127127
} else if (args.IsArgSet("-conf")) {

src/qt/guiutil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ void openDebugLogfile()
428428

429429
bool openBitcoinConf()
430430
{
431-
fs::path pathConfig = GetConfigFile(gArgs.GetPathArg("-conf", BITCOIN_CONF_FILENAME));
431+
fs::path pathConfig = gArgs.GetConfigFilePath();
432432

433433
/* Create the file */
434434
std::ofstream configFile{pathConfig, std::ios_base::app};

0 commit comments

Comments
 (0)