From 716de29dd8672d28bfe0a08424e9958fe61054d2 Mon Sep 17 00:00:00 2001 From: Kiminuo Date: Thu, 20 May 2021 22:28:06 +0200 Subject: [PATCH] Make `m_cached_blocks_path` mutable. Make `ArgsManager::GetBlocksDirPath()` const. --- src/util/system.cpp | 2 +- src/util/system.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/system.cpp b/src/util/system.cpp index 9b3bd46b38..06684c78ad 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -388,7 +388,7 @@ std::optional ArgsManager::GetArgFlags(const std::string& name) co return std::nullopt; } -const fs::path& ArgsManager::GetBlocksDirPath() +const fs::path& ArgsManager::GetBlocksDirPath() const { LOCK(cs_args); fs::path& path = m_cached_blocks_path; diff --git a/src/util/system.h b/src/util/system.h index f68975ffa3..88a217f71d 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -195,7 +195,7 @@ protected: std::map> m_available_args GUARDED_BY(cs_args); bool m_accept_any_command GUARDED_BY(cs_args){true}; std::list 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,7 +266,7 @@ public: * * @return Blocks path which is network specific */ - const fs::path& GetBlocksDirPath(); + const fs::path& GetBlocksDirPath() const; /** * Get data directory path