aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorAntoine Poinsot <darosior@protonmail.com>2024-10-20 20:29:08 +0200
committerAntoine Poinsot <darosior@protonmail.com>2024-10-24 18:23:29 +0200
commit844770b05ebc34789dc46d70cd6398089539c915 (patch)
tree044ec05de365b5078a9c3e8171d00406e20b02b5 /src/qt
parentdd92911732d44b46dc6e66550707e64bad4af905 (diff)
qt: remove UPnP settings
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/forms/optionsdialog.ui10
-rw-r--r--src/qt/optionsdialog.cpp5
-rw-r--r--src/qt/optionsmodel.cpp20
-rw-r--r--src/qt/optionsmodel.h1
-rw-r--r--src/qt/test/optiontests.cpp3
-rw-r--r--src/qt/test/test_main.cpp1
6 files changed, 3 insertions, 37 deletions
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index 2056b2cccd..9ab6b124e0 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -316,16 +316,6 @@
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_Network">
<item>
- <widget class="QCheckBox" name="mapPortUpnp">
- <property name="toolTip">
- <string>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</string>
- </property>
- <property name="text">
- <string>Map port using &amp;UPnP</string>
- </property>
- </widget>
- </item>
- <item>
<widget class="QCheckBox" name="mapPortNatpmp">
<property name="toolTip">
<string>Automatically open the Bitcoin client port on the router. This only works when your router supports PCP or NAT-PMP and it is enabled. The external port could be random.</string>
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index b70769ed24..f821b1ceb2 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -105,10 +105,6 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
connect(ui->prune, &QPushButton::toggled, ui->pruneSize, &QWidget::setEnabled);
/* Network elements init */
-#ifndef USE_UPNP
- ui->mapPortUpnp->setEnabled(false);
-#endif
-
ui->proxyIp->setEnabled(false);
ui->proxyPort->setEnabled(false);
ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));
@@ -300,7 +296,6 @@ void OptionsDialog::setMapper()
mapper->addMapping(ui->m_enable_psbt_controls, OptionsModel::EnablePSBTControls);
/* Network */
- mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
mapper->addMapping(ui->mapPortNatpmp, OptionsModel::MapPortNatpmp);
mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
mapper->addMapping(ui->enableServer, OptionsModel::Server);
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 5bca5c5320..acaa02aa85 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -41,7 +41,6 @@ static const char* SettingName(OptionsModel::OptionID option)
case OptionsModel::ThreadsScriptVerif: return "par";
case OptionsModel::SpendZeroConfChange: return "spendzeroconfchange";
case OptionsModel::ExternalSignerPath: return "signer";
- case OptionsModel::MapPortUPnP: return "upnp";
case OptionsModel::MapPortNatpmp: return "natpmp";
case OptionsModel::Listen: return "listen";
case OptionsModel::Server: return "server";
@@ -215,7 +214,7 @@ bool OptionsModel::Init(bilingual_str& error)
// These are shared with the core or have a command-line parameter
// and we want command-line parameters to overwrite the GUI settings.
- for (OptionID option : {DatabaseCache, ThreadsScriptVerif, SpendZeroConfChange, ExternalSignerPath, MapPortUPnP,
+ for (OptionID option : {DatabaseCache, ThreadsScriptVerif, SpendZeroConfChange, ExternalSignerPath,
MapPortNatpmp, Listen, Server, Prune, ProxyUse, ProxyUseTor, Language}) {
std::string setting = SettingName(option);
if (node().isSettingIgnored(setting)) addOverriddenOption("-" + setting);
@@ -412,12 +411,6 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
return m_show_tray_icon;
case MinimizeToTray:
return fMinimizeToTray;
- case MapPortUPnP:
-#ifdef USE_UPNP
- return SettingToBool(setting(), DEFAULT_UPNP);
-#else
- return false;
-#endif // USE_UPNP
case MapPortNatpmp:
return SettingToBool(setting(), DEFAULT_NATPMP);
case MinimizeOnClose:
@@ -530,16 +523,10 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
fMinimizeToTray = value.toBool();
settings.setValue("fMinimizeToTray", fMinimizeToTray);
break;
- case MapPortUPnP: // core option - can be changed on-the-fly
- if (changed()) {
- update(value.toBool());
- node().mapPort(value.toBool(), getOption(MapPortNatpmp).toBool());
- }
- break;
case MapPortNatpmp: // core option - can be changed on-the-fly
if (changed()) {
update(value.toBool());
- node().mapPort(getOption(MapPortUPnP).toBool(), value.toBool());
+ node().mapPort(false, value.toBool());
}
break;
case MinimizeOnClose:
@@ -789,7 +776,6 @@ void OptionsModel::checkAndMigrate()
migrate_setting(SpendZeroConfChange, "bSpendZeroConfChange");
migrate_setting(ExternalSignerPath, "external_signer_path");
#endif
- migrate_setting(MapPortUPnP, "fUseUPnP");
migrate_setting(MapPortNatpmp, "fUseNatpmp");
migrate_setting(Listen, "fListen");
migrate_setting(Server, "server");
@@ -803,7 +789,7 @@ void OptionsModel::checkAndMigrate()
// In case migrating QSettings caused any settings value to change, rerun
// parameter interaction code to update other settings. This is particularly
- // important for the -listen setting, which should cause -listenonion, -upnp,
+ // important for the -listen setting, which should cause -listenonion
// and other settings to default to false if it was set to false.
// (https://github.com/bitcoin-core/gui/issues/567).
node().initParameterInteraction();
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index b5ea6c783e..c24b35ed79 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -50,7 +50,6 @@ public:
StartAtStartup, // bool
ShowTrayIcon, // bool
MinimizeToTray, // bool
- MapPortUPnP, // bool
MapPortNatpmp, // bool
MinimizeOnClose, // bool
ProxyUse, // bool
diff --git a/src/qt/test/optiontests.cpp b/src/qt/test/optiontests.cpp
index 4f3eb778c5..4d25d4994d 100644
--- a/src/qt/test/optiontests.cpp
+++ b/src/qt/test/optiontests.cpp
@@ -37,7 +37,6 @@ void OptionTests::migrateSettings()
QSettings settings;
settings.setValue("nDatabaseCache", 600);
settings.setValue("nThreadsScriptVerif", 12);
- settings.setValue("fUseUPnP", false);
settings.setValue("fListen", false);
settings.setValue("bPrune", true);
settings.setValue("nPruneSize", 3);
@@ -50,7 +49,6 @@ void OptionTests::migrateSettings()
QVERIFY(settings.contains("nDatabaseCache"));
QVERIFY(settings.contains("nThreadsScriptVerif"));
- QVERIFY(settings.contains("fUseUPnP"));
QVERIFY(settings.contains("fListen"));
QVERIFY(settings.contains("bPrune"));
QVERIFY(settings.contains("nPruneSize"));
@@ -64,7 +62,6 @@ void OptionTests::migrateSettings()
QVERIFY(options.Init(error));
QVERIFY(!settings.contains("nDatabaseCache"));
QVERIFY(!settings.contains("nThreadsScriptVerif"));
- QVERIFY(!settings.contains("fUseUPnP"));
QVERIFY(!settings.contains("fListen"));
QVERIFY(!settings.contains("bPrune"));
QVERIFY(!settings.contains("nPruneSize"));
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index 172c06f4ea..f3430c7822 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -54,7 +54,6 @@ int main(int argc, char* argv[])
gArgs.ForceSetArg("-discover", "0");
gArgs.ForceSetArg("-dnsseed", "0");
gArgs.ForceSetArg("-fixedseeds", "0");
- gArgs.ForceSetArg("-upnp", "0");
gArgs.ForceSetArg("-natpmp", "0");
std::string error;