From 5a0185b6c9c838290103314916190a0330ed9a82 Mon Sep 17 00:00:00 2001
From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Date: Sun, 23 Feb 2020 02:25:21 +0200
Subject: gui: Add NAT-PMP network option
---
src/qt/forms/optionsdialog.ui | 10 ++++++++++
src/qt/optionsdialog.cpp | 4 ++++
2 files changed, 14 insertions(+)
(limited to 'src')
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index 88944a58a6..8181cc47e2 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -259,6 +259,16 @@
+ -
+
+
+ Automatically open the Bitcoin client port on the router. This only works when your router supports NAT-PMP and it is enabled. The external port could be random.
+
+
+ Map port using NA&T-PMP
+
+
+
-
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 4057712a41..416b9c83c9 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -50,6 +50,9 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
/* Network elements init */
#ifndef USE_UPNP
ui->mapPortUpnp->setEnabled(false);
+#endif
+#ifndef USE_NATPMP
+ ui->mapPortNatpmp->setEnabled(false);
#endif
connect(this, &QDialog::accepted, [this](){
QSettings settings;
@@ -219,6 +222,7 @@ void OptionsDialog::setMapper()
/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
+ mapper->addMapping(ui->mapPortNatpmp, OptionsModel::MapPortNatpmp);
mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);
--
cgit v1.2.3