diff --git a/src/util/system.cpp b/src/util/system.cpp index b0af7eb30b..9ecadeabce 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -420,7 +420,7 @@ std::optional ArgsManager::GetArgFlags(const std::string& name) co return std::nullopt; } -const fs::path& ArgsManager::GetBlocksDirPath() const +const fs::path ArgsManager::GetBlocksDirPath() const { LOCK(cs_args); fs::path& path = m_cached_blocks_path; @@ -445,7 +445,7 @@ const fs::path& ArgsManager::GetBlocksDirPath() const return path; } -const fs::path& ArgsManager::GetDataDir(bool net_specific) const +const fs::path ArgsManager::GetDataDir(bool net_specific) const { LOCK(cs_args); fs::path& path = net_specific ? m_cached_network_datadir_path : m_cached_datadir_path; diff --git a/src/util/system.h b/src/util/system.h index 1ae230d4f8..4ab1905459 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -288,7 +288,7 @@ protected: * * @return Blocks path which is network specific */ - const fs::path& GetBlocksDirPath() const; + const fs::path GetBlocksDirPath() const; /** * Get data directory path @@ -296,7 +296,7 @@ protected: * @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& GetDataDirBase() const { return GetDataDir(false); } + const fs::path GetDataDirBase() const { return GetDataDir(false); } /** * Get data directory path with appended network identifier @@ -304,7 +304,7 @@ protected: * @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); } + const fs::path GetDataDirNet() const { return GetDataDir(true); } fs::path GetBackupsDirPath(); @@ -483,7 +483,7 @@ private: * @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; + const fs::path GetDataDir(bool net_specific) const; // Helper function for LogArgs(). void logArgsPrefix(