Skip to content

Commit 8062c3b

Browse files
committed
util: Add ArgsManager SetConfigFilePath method
Needed by multiprocess support code to pass parsed configuration to a spawned process.
1 parent 441d00c commit 8062c3b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/common/args.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,13 @@ fs::path ArgsManager::GetConfigFilePath() const
720720
return *Assert(m_config_path);
721721
}
722722

723+
void ArgsManager::SetConfigFilePath(fs::path path)
724+
{
725+
LOCK(cs_args);
726+
assert(!m_config_path);
727+
m_config_path = path;
728+
}
729+
723730
ChainType ArgsManager::GetChainType() const
724731
{
725732
std::variant<ChainType, std::string> arg = GetChainArg();

src/common/args.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class ArgsManager
180180
* Return config file path (read-only)
181181
*/
182182
fs::path GetConfigFilePath() const;
183+
void SetConfigFilePath(fs::path);
183184
[[nodiscard]] bool ReadConfigFiles(std::string& error, bool ignore_invalid_keys = false);
184185

185186
/**

0 commit comments

Comments
 (0)