mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
partial Merge #29040: refactor: Remove pre-C++20 code, fs::path cleanup
It fixes return reference to const variable under mutex which is not a good idea
This commit is contained in:
parent
042e8a4101
commit
a219a8be15
@ -420,7 +420,7 @@ std::optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) co
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fs::path& ArgsManager::GetBlocksDirPath() const
|
const fs::path ArgsManager::GetBlocksDirPath() const
|
||||||
{
|
{
|
||||||
LOCK(cs_args);
|
LOCK(cs_args);
|
||||||
fs::path& path = m_cached_blocks_path;
|
fs::path& path = m_cached_blocks_path;
|
||||||
@ -445,7 +445,7 @@ const fs::path& ArgsManager::GetBlocksDirPath() const
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fs::path& ArgsManager::GetDataDir(bool net_specific) const
|
const fs::path ArgsManager::GetDataDir(bool net_specific) const
|
||||||
{
|
{
|
||||||
LOCK(cs_args);
|
LOCK(cs_args);
|
||||||
fs::path& path = net_specific ? m_cached_network_datadir_path : m_cached_datadir_path;
|
fs::path& path = net_specific ? m_cached_network_datadir_path : m_cached_datadir_path;
|
||||||
|
@ -288,7 +288,7 @@ protected:
|
|||||||
*
|
*
|
||||||
* @return Blocks path which is network specific
|
* @return Blocks path which is network specific
|
||||||
*/
|
*/
|
||||||
const fs::path& GetBlocksDirPath() const;
|
const fs::path GetBlocksDirPath() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get data directory path
|
* 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
|
* @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
|
* @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
|
* 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
|
* @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
|
* @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();
|
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
|
* @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
|
* @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().
|
// Helper function for LogArgs().
|
||||||
void logArgsPrefix(
|
void logArgsPrefix(
|
||||||
|
Loading…
Reference in New Issue
Block a user