aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-02-16 15:00:16 -0500
committerPieter Wuille <pieter.wuille@gmail.com>2012-02-26 23:21:33 +0100
commit972060ce0e9746c979ce0ddeeb997121414c1d58 (patch)
tree9c676a8281e62513e9ee4b5f68e01a197dc6edf2 /src/net.cpp
parent4a10d4c6dcd04eb2496257754782150793ce53b1 (diff)
bitcoind changes to stop storing settings in wallet.dat.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp12
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()