aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-02-01 13:24:15 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-02-01 13:24:15 -0500
commit8beb917c6c2d70e245116ead8789767b0c58e2f6 (patch)
tree370bda8ad78cf74d24dd80ebff0569c9b94f0d5f
parent177dbcaace432f46b191add5c26226dbaac2c81c (diff)
Allow -upnp to override setting in wallet (and simplify logic a bit)
-rw-r--r--src/init.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/init.cpp b/src/init.cpp
index d237e247e7..4bb3312902 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -487,16 +487,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)
{