diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-12-05 15:57:12 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-06-10 09:58:45 -0500 |
commit | 49ee2a0ad88e0e656234b769d806987784ff1e28 (patch) | |
tree | 06c2db387a170d332bdb969980b4dee2293990d4 /src/node | |
parent | 1704bbf2263f16c720604cfab4ccb775315df690 (diff) | |
download | bitcoin-49ee2a0ad88e0e656234b769d806987784ff1e28.tar.xz |
Avoid wallet code writing node settings file
Change wallet loading code to access settings through the Chain
interface instead of writing settings.json directly.
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/interfaces.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 171f15d4fb..cc74eec57c 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -690,6 +690,14 @@ public: RPCRunLater(name, std::move(fn), seconds); } int rpcSerializationFlags() override { return RPCSerializationFlags(); } + util::SettingsValue getSetting(const std::string& name) override + { + return gArgs.GetSetting(name); + } + std::vector<util::SettingsValue> getSettingsList(const std::string& name) override + { + return gArgs.GetSettingsList(name); + } util::SettingsValue getRwSetting(const std::string& name) override { util::SettingsValue result; @@ -700,7 +708,7 @@ public: }); return result; } - bool updateRwSetting(const std::string& name, const util::SettingsValue& value) override + bool updateRwSetting(const std::string& name, const util::SettingsValue& value, bool write) override { gArgs.LockSettings([&](util::Settings& settings) { if (value.isNull()) { @@ -709,7 +717,7 @@ public: settings.rw_settings[name] = value; } }); - return gArgs.WriteSettingsFile(); + return !write || gArgs.WriteSettingsFile(); } void requestMempoolTransactions(Notifications& notifications) override { |