diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-02-23 02:25:21 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-01-07 18:07:10 +0200 |
commit | 5a0185b6c9c838290103314916190a0330ed9a82 (patch) | |
tree | eeb3e1eec3249d4fc22080604a5dc004af554057 /src/qt | |
parent | a39f7336a3b493d46a4486c4c94fdca1b3151370 (diff) | |
download | bitcoin-5a0185b6c9c838290103314916190a0330ed9a82.tar.xz |
gui: Add NAT-PMP network option
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/forms/optionsdialog.ui | 10 | ||||
-rw-r--r-- | src/qt/optionsdialog.cpp | 4 |
2 files changed, 14 insertions, 0 deletions
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 @@ -260,6 +260,16 @@ </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 NAT-PMP and it is enabled. The external port could be random.</string> + </property> + <property name="text"> + <string>Map port using NA&T-PMP</string> + </property> + </widget> + </item> + <item> <widget class="QCheckBox" name="allowIncoming"> <property name="toolTip"> <string>Accept connections from outside.</string> 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 @@ -51,6 +51,9 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : #ifndef USE_UPNP ui->mapPortUpnp->setEnabled(false); #endif +#ifndef USE_NATPMP + ui->mapPortNatpmp->setEnabled(false); +#endif connect(this, &QDialog::accepted, [this](){ QSettings settings; model->node().mapPort(settings.value("fUseUPnP").toBool(), settings.value("fUseNatpmp").toBool()); @@ -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); |