mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
settings: Add resetSettings() method
Allows the GUI to clear settings.json file and save settings.json.bak file when GUI "Reset Options" button is pressed or -resetguisettings command line option is used. (GUI code already backs up and resets the "guisettings.ini" file this way, so this just makes the same behavior possible for "settings.json")
This commit is contained in:
@@ -144,6 +144,14 @@ public:
|
||||
}
|
||||
});
|
||||
}
|
||||
void resetSettings() override
|
||||
{
|
||||
gArgs.WriteSettingsFile(/*errors=*/nullptr, /*backup=*/true);
|
||||
gArgs.LockSettings([&](util::Settings& settings) {
|
||||
settings.rw_settings.clear();
|
||||
});
|
||||
gArgs.WriteSettingsFile();
|
||||
}
|
||||
void mapPort(bool use_upnp, bool use_natpmp) override { StartMapPort(use_upnp, use_natpmp); }
|
||||
bool getProxy(Network net, Proxy& proxy_info) override { return GetProxy(net, proxy_info); }
|
||||
size_t getNodeCount(ConnectionDirection flags) override
|
||||
|
||||
Reference in New Issue
Block a user