Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 7: [PATCH 07/17] feat(rpc): preserve Roots operator interfaces on v31

src/common/args.h

Before: src/common/args.h · After: src/common/args.h

File metadata
index 97c32c87f7c069d3cca5b5b048e98578cb7b863c..5a6bc254e73090c2821f4f1731c0281417159f33 100644

Download original patch · Release notes

Diff rows 1–50 of 50. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/common/args.h CHANGED
@@ -26,6 +26,7 @@ class ArgsManager;
26
26
 
27
27
  extern const char * const BITCOIN_CONF_FILENAME;
28
28
  extern const char * const BITCOIN_SETTINGS_FILENAME;
29
+ extern const char * const BITCOIN_RW_CONF_FILENAME;
29
30
 
30
31
  // Return true if -datadir option points to a valid directory or is not specified.
31
32
  bool CheckDataDirOption(const ArgsManager& args);
@@ -66,6 +67,7 @@ enum class OptionsCategory {
66
67
  REGISTER_COMMANDS,
67
68
  CLI_COMMANDS,
68
69
  IPC,
70
+ STATS,
69
71
 
70
72
  HIDDEN // Always the last option to avoid printing these in the help
71
73
  };
@@ -99,6 +101,8 @@ std::optional<Int> SettingTo(const common::SettingsValue&);
99
101
  bool SettingToBool(const common::SettingsValue&, bool);
100
102
  std::optional<bool> SettingToBool(const common::SettingsValue&);
101
103
 
104
+ void ModifyRWConfigStream(std::istream& stream_in, std::ostream& stream_out, const std::map<std::string, std::string>& settings_to_change);
105
+
102
106
  class ArgsManager
103
107
  {
104
108
  public:
@@ -146,11 +150,13 @@ protected:
146
150
  bool m_accept_any_command GUARDED_BY(cs_args){true};
147
151
  std::list<SectionInfo> m_config_sections GUARDED_BY(cs_args);
148
152
  std::optional<fs::path> m_config_path GUARDED_BY(cs_args);
153
+ std::optional<fs::path> m_rwconf_path GUARDED_BY(cs_args);
154
+ bool m_rwconf_had_prune_option GUARDED_BY(cs_args){false};
149
155
  mutable fs::path m_cached_blocks_path GUARDED_BY(cs_args);
150
156
  mutable fs::path m_cached_datadir_path GUARDED_BY(cs_args);
151
157
  mutable fs::path m_cached_network_datadir_path GUARDED_BY(cs_args);
152
158
 
153
- [[nodiscard]] bool ReadConfigStream(std::istream& stream, const std::string& filepath, std::string& error, bool ignore_invalid_keys = false);
159
+ [[nodiscard]] bool ReadConfigStream(std::istream& stream, const std::string& filepath, std::string& error, bool ignore_invalid_keys = false, std::map<std::string, std::vector<common::SettingsValue>>* settings_target = nullptr);
154
160
 
155
161
  /**
156
162
  * Returns true if settings values from the default section should be used,
@@ -189,8 +195,14 @@ protected:
189
195
  */
190
196
  fs::path GetConfigFilePath() const;
191
197
  void SetConfigFilePath(fs::path);
198
+ fs::path GetRWConfigFilePath() const;
192
199
  [[nodiscard]] bool ReadConfigFiles(std::string& error, bool ignore_invalid_keys = false);
193
200
 
201
+ bool RWConfigHasPruneOption() const { LOCK(cs_args); return m_rwconf_had_prune_option; }
202
+ void ModifyRWConfigFile(const std::map<std::string, std::string>& settings_to_change, bool also_settings_json = true);
203
+ void ModifyRWConfigFile(const std::string& setting_to_change, const std::string& new_value, bool also_settings_json = true);
204
+ void EraseRWConfigFile();
205
+
194
206
  /**
195
207
  * Log warnings for options in m_section_only_args when
196
208
  * they are specified in the default section but not overridden