From 1b6d8f3fca6aef79ea0ccb26303d982d6da78cd1 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 1 Feb 2012 13:24:15 -0500 Subject: Allow -upnp to override setting in wallet (and simplify logic a bit) --- src/init.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index d1332e0610..12e890cbb4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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) { -- cgit v1.2.3