diff options
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp index 546bc6adc8..5d45e10d05 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -43,6 +43,7 @@ bool OpenNetworkConnection(const CAddress& addrConnect); // bool fClient = false; bool fAllowDNS = false; +static bool fUseUPnP = false; uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK); CAddress addrLocalHost(CService("0.0.0.0", 0), nLocalServices); static CNode* pnodeLocalHost = NULL; @@ -1102,7 +1103,6 @@ void MapPort(bool fMapPort) if (fUseUPnP != fMapPort) { fUseUPnP = fMapPort; - WriteSetting("fUseUPnP", fUseUPnP); } if (fUseUPnP && vnThreadsRunning[THREAD_UPNP] < 1) { @@ -1711,6 +1711,14 @@ bool BindListenPort(string& strError) void StartNode(void* parg) { +#ifdef USE_UPNP +#if USE_UPNP + fUseUPnP = GetBoolArg("-upnp", true); +#else + fUseUPnP = GetBoolArg("-upnp", false); +#endif +#endif + if (pnodeLocalHost == NULL) pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices)); @@ -1812,7 +1820,7 @@ void StartNode(void* parg) printf("Error: CreateThread(ThreadMessageHandler) failed\n"); // Generate coins in the background - GenerateBitcoins(fGenerateBitcoins, pwalletMain); + GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain); } bool StopNode() |