diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2022-03-07 13:29:46 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2022-03-09 11:03:05 -0500 |
commit | 7e1b968f61a1309dfd0fc4f7cd5a2d964bfc4f30 (patch) | |
tree | 77c2670192333419e5af6e065cd6b8c562761784 /src/qt/test/optiontests.cpp | |
parent | 4607f700d07cd813db4e8ef516b68a759674e1db (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.
Github-Pull: bitcoin/bitcoin#24498
Rebased-From: 5b1aae12ca4a99c6b09349981a4902717a6a5d3e
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"); }); |