diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-02-01 13:24:15 -0500 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-02-02 17:45:04 -0500 |
commit | 1b6d8f3fca6aef79ea0ccb26303d982d6da78cd1 (patch) | |
tree | 7e6b2379f7462aa9e98dff86376ab5d663457ccf | |
parent | e5b031f5d2a467fa28fbf7667101909a28e430bb (diff) |
Allow -upnp to override setting in wallet (and simplify logic a bit)
-rw-r--r-- | src/init.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
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) { |