aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2022-04-18 19:19:02 -0400
committerRyan Ofsky <ryan@ofsky.org>2022-05-26 11:05:10 -0400
commitd2ada6e63583cad91e92b49c4dbf8c7ff086a758 (patch)
treeceb02927072e15fa83e0cbead1bdcec9a78ae8e6 /src/qt/test
parent1dc4fc29c1086420b7dc51b20c0b7a18fecb4462 (diff)
downloadbitcoin-d2ada6e63583cad91e92b49c4dbf8c7ff086a758.tar.xz
Migrate -upnp and -natpmp settings from QSettings to settings.json
This also effectively reverts 58e8364dcdc4e57b0caac09f8402e6535301de9b from #18077, applying upnp and natpmp settings from the optionsmodel class instead of the optionsdialog class. This makes sense because model code, not view code is responsible for applying all other settings, and because leaving these settings half-applied in optionsmodel seems error prone and could lead to bugs. (These things were discussed a little in https://github.com/bitcoin/bitcoin/pull/18077#discussion_r560381734)
Diffstat (limited to 'src/qt/test')
-rw-r--r--src/qt/test/optiontests.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qt/test/optiontests.cpp b/src/qt/test/optiontests.cpp
index fa3fe031ec..d84dc524cd 100644
--- a/src/qt/test/optiontests.cpp
+++ b/src/qt/test/optiontests.cpp
@@ -34,6 +34,7 @@ void OptionTests::migrateSettings()
QSettings settings;
settings.setValue("nDatabaseCache", 600);
settings.setValue("nThreadsScriptVerif", 12);
+ settings.setValue("fUseUPnP", false);
settings.sync();
@@ -42,6 +43,7 @@ void OptionTests::migrateSettings()
QVERIFY(options.Init(error));
QVERIFY(!settings.contains("nDatabaseCache"));
QVERIFY(!settings.contains("nThreadsScriptVerif"));
+ QVERIFY(!settings.contains("fUseUPnP"));
std::ifstream file(gArgs.GetDataDirNet() / "settings.json");
QCOMPARE(std::string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()).c_str(), "{\n"