diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2022-03-07 13:29:46 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2022-03-07 13:29:46 -0500 |
commit | 5b1aae12ca4a99c6b09349981a4902717a6a5d3e (patch) | |
tree | 98fa7d25f43f6ca80baa9e1d9c69fcfd9295042a /src/qt/test/optiontests.cpp | |
parent | 84b0973e35dae63cd1b60199b481e24d54e58c97 (diff) |
qt: Avoid crash on startup if int specified in settings.json
Fix GUI startup crash reported by Rspigler in
https://github.com/bitcoin/bitcoin/issues/24457 that happens if
settings.json contains an integer value for any of the configuration
options which GUI settings can currently clash with (-dbcache, -par,
-spendzeroconfchange, -signer, -upnp, -natpmp, -listen, -server, -proxy,
-proxy, -onion, -onion, -lang, and -prune).
Fix is a one-line change in ArgsManager::GetArg.
Diffstat (limited to 'src/qt/test/optiontests.cpp')
-rw-r--r-- | src/qt/test/optiontests.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qt/test/optiontests.cpp b/src/qt/test/optiontests.cpp index 80d8d77984..51894e1915 100644 --- a/src/qt/test/optiontests.cpp +++ b/src/qt/test/optiontests.cpp @@ -15,15 +15,15 @@ //! Entry point for BitcoinApplication tests. void OptionTests::optionTests() { - // Test regression https://github.com/bitcoin/bitcoin/issues/24457. Check - // if setting an integer prune value causes an exception to be thrown in - // the OptionsModel constructor. + // Test regression https://github.com/bitcoin/bitcoin/issues/24457. Ensure + // that setting integer prune value doesn't cause an exception to be thrown + // in the OptionsModel constructor gArgs.LockSettings([&](util::Settings& settings) { settings.forced_settings.erase("prune"); settings.rw_settings["prune"] = 3814; }); gArgs.WriteSettingsFile(); - QVERIFY_EXCEPTION_THROWN(OptionsModel{}, std::runtime_error); + OptionsModel{}; gArgs.LockSettings([&](util::Settings& settings) { settings.rw_settings.erase("prune"); }); |