From 9d952d17bb1bd05d5dbfb620f669adfbc223ce0e Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 6 Feb 2012 14:35:57 -0500 Subject: [PATCH] Look for flushwallet/listen/irc/dnsseed/upnp instead of noflushwallet/etc. And switch default for irc to 0. --- src/db.cpp | 2 +- src/init.cpp | 28 ++++++++++++++-------------- src/irc.cpp | 3 ++- src/net.cpp | 4 ++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index 07f58ef..196363a 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -990,7 +990,7 @@ void ThreadFlushWalletDB(void* parg) if (fOneThread) return; fOneThread = true; - if (mapArgs.count("-noflushwallet")) + if (!GetBoolArg("-flushwallet", true)) return; unsigned int nLastSeen = nWalletDBUpdated; diff --git a/src/init.cpp b/src/init.cpp index 97f5ce7..c4c70f6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -194,18 +194,18 @@ bool AppInit2(int argc, char* argv[]) " -maxconnections=\t " + _("Maintain at most connections to peers (default: 125)") + "\n" + " -addnode= \t " + _("Add a node to connect to and attempt to keep the connection open") + "\n" + " -connect= \t\t " + _("Connect only to the specified node") + "\n" + - " -noirc \t " + _("Don't find peers using internet relay chat") + "\n" + - " -nolisten \t " + _("Don't accept connections from outside") + "\n" + - " -nodnsseed \t " + _("Don't bootstrap list of peers using DNS") + "\n" + + " -irc \t " + _("Find peers using internet relay chat (default: 0)") + "\n" + + " -listen \t " + _("Accept connections from outside (default: 1)") + "\n" + + " -dnsseed \t " + _("Find peers using DNS lookup (default: 1)") + "\n" + " -banscore= \t " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n" + " -bantime= \t " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n" + " -maxreceivebuffer=\t " + _("Maximum per-connection receive buffer, *1000 bytes (default: 10000)") + "\n" + " -maxsendbuffer=\t " + _("Maximum per-connection send buffer, *1000 bytes (default: 10000)") + "\n" + #ifdef USE_UPNP #if USE_UPNP - " -noupnp \t " + _("Don't attempt to use UPnP to map the listening port") + "\n" + + " -upnp \t " + _("Use Universal Plug and Play to map the listening port (default: 1)") + "\n" + #else - " -upnp \t " + _("Attempt to use UPnP to map the listening port") + "\n" + + " -upnp \t " + _("Use Universal Plug and Play to map the listening port (default: 0)") + "\n" + #endif #endif " -paytxfee= \t " + _("Fee per KB to add to transactions you send") + "\n" + @@ -476,16 +476,15 @@ bool AppInit2(int argc, char* argv[]) { // Use SoftSetBoolArg here so user can override any of these if they wish. // Note: the GetBoolArg() calls for all of these must happen later. - SoftSetBoolArg("-nolisten", true); - SoftSetBoolArg("-noirc", true); - SoftSetBoolArg("-nodnsseed", true); - SoftSetBoolArg("-noupnp", true); + SoftSetBoolArg("-listen", false); + SoftSetBoolArg("-irc", false); + SoftSetBoolArg("-dnsseed", false); SoftSetBoolArg("-upnp", false); SoftSetBoolArg("-dns", false); } fAllowDNS = GetBoolArg("-dns"); - fNoListen = GetBoolArg("-nolisten"); + fNoListen = !GetBoolArg("-listen", true); // This code can be removed once a super-majority of the network has upgraded. if (GetBoolArg("-bip16", true)) @@ -507,10 +506,11 @@ bool AppInit2(int argc, char* argv[]) } // Command-line args override in-wallet settings: - if (mapArgs.count("-upnp")) - fUseUPnP = GetBoolArg("-upnp"); - else if (mapArgs.count("-noupnp")) - fUseUPnP = !GetBoolArg("-noupnp"); +#if USE_UPNP + fUseUPnP = GetBoolArg("-upnp", true); +#else + fUseUPnP = GetBoolArg("-upnp", false); +#endif if (!fNoListen) { diff --git a/src/irc.cpp b/src/irc.cpp index 8805c7f..78d86e1 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -261,8 +261,9 @@ void ThreadIRCSeed2(void* parg) if (mapArgs.count("-connect") || fNoListen) return; - if (GetBoolArg("-noirc")) + if (!GetBoolArg("-irc", false)) return; + printf("ThreadIRCSeed started\n"); int nErrorWait = 10; int nRetryWait = 10; diff --git a/src/net.cpp b/src/net.cpp index a7eaaac..b6f2951 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -200,7 +200,7 @@ bool GetMyExternalIP(CNetAddr& ipRet) void ThreadGetMyExternalIP(void* parg) { // Wait for IRC to get it first - if (!GetBoolArg("-noirc")) + if (GetBoolArg("-irc", false)) { for (int i = 0; i < 2 * 60; i++) { @@ -1706,7 +1706,7 @@ void StartNode(void* parg) // Start threads // - if (GetBoolArg("-nodnsseed")) + if (!GetBoolArg("-dnsseed", true)) printf("DNS seeding disabled\n"); else if (!CreateThread(ThreadDNSAddressSeed, NULL)) -- 1.7.1