|
|
@ -4,6 +4,7 @@
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
|
|
|
|
#include <util.h>
|
|
|
|
#include <util.h>
|
|
|
|
|
|
|
|
#include <fs.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <chainparamsbase.h>
|
|
|
|
#include <chainparamsbase.h>
|
|
|
|
#include <random.h>
|
|
|
|
#include <random.h>
|
|
|
@ -188,11 +189,7 @@ static void DebugPrintInit()
|
|
|
|
fs::path GetDebugLogPath()
|
|
|
|
fs::path GetDebugLogPath()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fs::path logfile(gArgs.GetArg("-debuglogfile", DEFAULT_DEBUGLOGFILE));
|
|
|
|
fs::path logfile(gArgs.GetArg("-debuglogfile", DEFAULT_DEBUGLOGFILE));
|
|
|
|
if (logfile.is_absolute()) {
|
|
|
|
return AbsPathForConfigVal(logfile);
|
|
|
|
return logfile;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return GetDataDir() / logfile;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool OpenDebugLog()
|
|
|
|
bool OpenDebugLog()
|
|
|
@ -624,11 +621,7 @@ void ClearDatadirCache()
|
|
|
|
|
|
|
|
|
|
|
|
fs::path GetConfigFile(const std::string& confPath)
|
|
|
|
fs::path GetConfigFile(const std::string& confPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fs::path pathConfigFile(confPath);
|
|
|
|
return AbsPathForConfigVal(fs::path(confPath), false);
|
|
|
|
if (!pathConfigFile.is_complete())
|
|
|
|
|
|
|
|
pathConfigFile = GetDataDir(false) / pathConfigFile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return pathConfigFile;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ArgsManager::ReadConfigFile(const std::string& confPath)
|
|
|
|
void ArgsManager::ReadConfigFile(const std::string& confPath)
|
|
|
@ -663,9 +656,7 @@ void ArgsManager::ReadConfigFile(const std::string& confPath)
|
|
|
|
#ifndef WIN32
|
|
|
|
#ifndef WIN32
|
|
|
|
fs::path GetPidFile()
|
|
|
|
fs::path GetPidFile()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fs::path pathPidFile(gArgs.GetArg("-pid", BITCOIN_PID_FILENAME));
|
|
|
|
return AbsPathForConfigVal(fs::path(gArgs.GetArg("-pid", BITCOIN_PID_FILENAME)));
|
|
|
|
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
|
|
|
|
|
|
|
|
return pathPidFile;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CreatePidFile(const fs::path &path, pid_t pid)
|
|
|
|
void CreatePidFile(const fs::path &path, pid_t pid)
|
|
|
@ -936,3 +927,8 @@ int64_t GetStartupTime()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return nStartupTime;
|
|
|
|
return nStartupTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return fs::absolute(path, GetDataDir(net_specific));
|
|
|
|
|
|
|
|
}
|
|
|
|