diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-02-01 13:24:15 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2012-02-01 13:24:15 -0500 |
commit | 8beb917c6c2d70e245116ead8789767b0c58e2f6 (patch) | |
tree | 370bda8ad78cf74d24dd80ebff0569c9b94f0d5f /src | |
parent | 177dbcaace432f46b191add5c26226dbaac2c81c (diff) |
Allow -upnp to override setting in wallet (and simplify logic a bit)
Diffstat (limited to 'src')
-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 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) { |