aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-04-29 22:46:34 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-07-24 18:42:59 +0300
commitc1f325126cf51d28dce8da74bfdf5cd05ab237ea (patch)
tree8cd0b9cc71321f5e84d86b75b540d7c1e462e169 /src/util/system.cpp
parent0626b8cbdf0aa971500eb5613c7ab4096c496966 (diff)
downloadbitcoin-c1f325126cf51d28dce8da74bfdf5cd05ab237ea.tar.xz
Return absolute path early in AbsPathForConfigVal
This prevents premature GetDataDir() calls, e.g., when config file is not read yet.
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r--src/util/system.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index 72b37b9187..d9e23199ec 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -1202,6 +1202,9 @@ int64_t GetStartupTime()
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
{
+ if (path.is_absolute()) {
+ return path;
+ }
return fs::absolute(path, GetDataDir(net_specific));
}