Allow -upnp to override setting in wallet (and simplify logic a bit)

This commit is contained in:
Gavin Andresen
2012-02-01 13:24:15 -05:00
committed by Luke Dashjr
parent e5b031f5d2
commit 1b6d8f3fca

View File

@@ -516,16 +516,11 @@ bool AppInit2(int argc, char* argv[])
fAllowDNS = GetBoolArg("-dns");
fNoListen = GetBoolArg("-nolisten");
if (fHaveUPnP)
{
#if USE_UPNP
if (GetBoolArg("-noupnp"))
fUseUPnP = false;
#else
if (GetBoolArg("-upnp"))
fUseUPnP = true;
#endif
}
// Command-line args override in-wallet settings:
if (mapArgs.count("-upnp"))
fUseUPnP = GetBoolArg("-upnp");
else if (mapArgs.count("-noupnp"))
fUseUPnP = !GetBoolArg("-noupnp");
if (!fNoListen)
{