diff options
| author | Hennadii Stepanov <[email protected]> | 2019-04-29 22:46:34 +0300 |
|---|---|---|
| committer | Hennadii Stepanov <[email protected]> | 2019-07-24 18:42:59 +0300 |
| commit | c1f325126cf51d28dce8da74bfdf5cd05ab237ea (patch) | |
| tree | 8cd0b9cc71321f5e84d86b75b540d7c1e462e169 /src/util/system.cpp | |
| parent | Merge #16445: test: Skip flaky p2p_invalid_messages test on macOS (diff) | |
| download | discoin-c1f325126cf51d28dce8da74bfdf5cd05ab237ea.tar.xz discoin-c1f325126cf51d28dce8da74bfdf5cd05ab237ea.zip | |
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.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index 72b37b918..d9e23199e 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)); } |