Merge pull request #4132
d4e1c61
add DEFAULT_UPNP constant in net (Philip Kaufmann)
This commit is contained in:
commit
67f43a99ae
@ -1733,10 +1733,8 @@ void StartNode(boost::thread_group& threadGroup)
|
|||||||
else
|
else
|
||||||
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "dnsseed", &ThreadDNSAddressSeed));
|
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "dnsseed", &ThreadDNSAddressSeed));
|
||||||
|
|
||||||
#ifdef USE_UPNP
|
|
||||||
// Map ports with UPnP
|
// Map ports with UPnP
|
||||||
MapPort(GetBoolArg("-upnp", USE_UPNP));
|
MapPort(GetBoolArg("-upnp", DEFAULT_UPNP));
|
||||||
#endif
|
|
||||||
|
|
||||||
// Send and receive from sockets, accept connections
|
// Send and receive from sockets, accept connections
|
||||||
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "net", &ThreadSocketHandler));
|
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "net", &ThreadSocketHandler));
|
||||||
|
@ -38,6 +38,12 @@ namespace boost {
|
|||||||
|
|
||||||
/** The maximum number of entries in an 'inv' protocol message */
|
/** The maximum number of entries in an 'inv' protocol message */
|
||||||
static const unsigned int MAX_INV_SZ = 50000;
|
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 ReceiveFloodSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); }
|
||||||
inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); }
|
inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); }
|
||||||
|
@ -106,11 +106,7 @@ void OptionsModel::Init()
|
|||||||
|
|
||||||
// Network
|
// Network
|
||||||
if (!settings.contains("fUseUPnP"))
|
if (!settings.contains("fUseUPnP"))
|
||||||
#ifdef USE_UPNP
|
settings.setValue("fUseUPnP", DEFAULT_UPNP);
|
||||||
settings.setValue("fUseUPnP", true);
|
|
||||||
#else
|
|
||||||
settings.setValue("fUseUPnP", false);
|
|
||||||
#endif
|
|
||||||
if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
|
if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
|
||||||
addOverriddenOption("-upnp");
|
addOverriddenOption("-upnp");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user