// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Copyright (c) 2011 The Bitcoin developers
+// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
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)
{