aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net.cpp4
-rw-r--r--src/net.h6
-rw-r--r--src/qt/optionsmodel.cpp6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 6bde1e7999..7cabfef099 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1736,10 +1736,8 @@ void StartNode(boost::thread_group& threadGroup)
else
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "dnsseed", &ThreadDNSAddressSeed));
-#ifdef USE_UPNP
// Map ports with UPnP
- MapPort(GetBoolArg("-upnp", USE_UPNP));
-#endif
+ MapPort(GetBoolArg("-upnp", DEFAULT_UPNP));
// Send and receive from sockets, accept connections
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "net", &ThreadSocketHandler));
diff --git a/src/net.h b/src/net.h
index 729b1bcd57..21b8dd242f 100644
--- a/src/net.h
+++ b/src/net.h
@@ -38,6 +38,12 @@ namespace boost {
/** The maximum number of entries in an 'inv' protocol message */
static const unsigned int MAX_INV_SZ = 50000;
+/** -upnp default */
+#ifdef USE_UPNP
+static const bool DEFAULT_UPNP = USE_UPNP;
+#else
+static const bool DEFAULT_UPNP = false;
+#endif
inline unsigned int ReceiveFloodSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); }
inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); }
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index e87a1d97e7..051098315d 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -106,11 +106,7 @@ void OptionsModel::Init()
// Network
if (!settings.contains("fUseUPnP"))
-#ifdef USE_UPNP
- settings.setValue("fUseUPnP", true);
-#else
- settings.setValue("fUseUPnP", false);
-#endif
+ settings.setValue("fUseUPnP", DEFAULT_UPNP);
if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
addOverriddenOption("-upnp");