mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 16:53:52 +02:00
net: Add -natpmp command line option
This commit is contained in:
@@ -124,6 +124,13 @@ void OptionsModel::Init(bool resetSettings)
|
||||
if (!gArgs.SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
|
||||
addOverriddenOption("-upnp");
|
||||
|
||||
if (!settings.contains("fUseNatpmp")) {
|
||||
settings.setValue("fUseNatpmp", DEFAULT_NATPMP);
|
||||
}
|
||||
if (!gArgs.SoftSetBoolArg("-natpmp", settings.value("fUseNatpmp").toBool())) {
|
||||
addOverriddenOption("-natpmp");
|
||||
}
|
||||
|
||||
if (!settings.contains("fListen"))
|
||||
settings.setValue("fListen", DEFAULT_LISTEN);
|
||||
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
|
||||
@@ -283,7 +290,13 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
||||
return settings.value("fUseUPnP");
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif // USE_UPNP
|
||||
case MapPortNatpmp:
|
||||
#ifdef USE_NATPMP
|
||||
return settings.value("fUseNatpmp");
|
||||
#else
|
||||
return false;
|
||||
#endif // USE_NATPMP
|
||||
case MinimizeOnClose:
|
||||
return fMinimizeOnClose;
|
||||
|
||||
@@ -356,6 +369,9 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||
case MapPortUPnP: // core option - can be changed on-the-fly
|
||||
settings.setValue("fUseUPnP", value.toBool());
|
||||
break;
|
||||
case MapPortNatpmp: // core option - can be changed on-the-fly
|
||||
settings.setValue("fUseNatpmp", value.toBool());
|
||||
break;
|
||||
case MinimizeOnClose:
|
||||
fMinimizeOnClose = value.toBool();
|
||||
settings.setValue("fMinimizeOnClose", fMinimizeOnClose);
|
||||
|
||||
Reference in New Issue
Block a user