aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/system.h')
-rw-r--r--src/util/system.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/util/system.h b/src/util/system.h
index f68975ffa3..c4317c62d0 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -90,7 +90,6 @@ void ReleaseDirectoryLocks();
bool TryCreateDirectories(const fs::path& p);
fs::path GetDefaultDataDir();
-const fs::path &GetDataDir(bool fNetSpecific = true);
// Return true if -datadir option points to a valid directory or is not specified.
bool CheckDataDirOption();
fs::path GetConfigFile(const std::string& confPath);
@@ -119,7 +118,7 @@ UniValue RunCommandParseJSON(const std::string& str_command, const std::string&
* the datadir if they are not absolute.
*
* @param path The path to be conditionally prefixed with datadir.
- * @param net_specific Forwarded to GetDataDir().
+ * @param net_specific Use network specific datadir variant
* @return The normalized path.
*/
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific = true);
@@ -195,7 +194,7 @@ protected:
std::map<OptionsCategory, std::map<std::string, Arg>> m_available_args GUARDED_BY(cs_args);
bool m_accept_any_command GUARDED_BY(cs_args){true};
std::list<SectionInfo> m_config_sections GUARDED_BY(cs_args);
- fs::path m_cached_blocks_path GUARDED_BY(cs_args);
+ mutable fs::path m_cached_blocks_path GUARDED_BY(cs_args);
mutable fs::path m_cached_datadir_path GUARDED_BY(cs_args);
mutable fs::path m_cached_network_datadir_path GUARDED_BY(cs_args);
@@ -266,16 +265,23 @@ public:
*
* @return Blocks path which is network specific
*/
- const fs::path& GetBlocksDirPath();
+ const fs::path& GetBlocksDirPath() const;
/**
* Get data directory path
*
- * @param net_specific Append network identifier to the returned path
* @return Absolute path on success, otherwise an empty path when a non-directory path would be returned
* @post Returned directory path is created unless it is empty
*/
- const fs::path& GetDataDirPath(bool net_specific = true) const;
+ const fs::path& GetDataDirBase() const { return GetDataDir(false); }
+
+ /**
+ * Get data directory path with appended network identifier
+ *
+ * @return Absolute path on success, otherwise an empty path when a non-directory path would be returned
+ * @post Returned directory path is created unless it is empty
+ */
+ const fs::path& GetDataDirNet() const { return GetDataDir(true); }
/**
* Clear cached directory paths
@@ -437,6 +443,15 @@ public:
void LogArgs() const;
private:
+ /**
+ * Get data directory path
+ *
+ * @param net_specific Append network identifier to the returned path
+ * @return Absolute path on success, otherwise an empty path when a non-directory path would be returned
+ * @post Returned directory path is created unless it is empty
+ */
+ const fs::path& GetDataDir(bool net_specific) const;
+
// Helper function for LogArgs().
void logArgsPrefix(
const std::string& prefix,