From de10efd154d6c02fe8549a2dc9649a96cf601fd2 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 25 Sep 2014 09:01:54 +0200 Subject: add -timeout default as constant and use them - update help message text - simplify code in init to check for -timeout --- src/init.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 980c589b29..d3cb3c32d5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -260,7 +260,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -port= " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n"; strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; strUsage += " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n"; - strUsage += " -timeout= " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n"; + strUsage += " -timeout= " + strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"), DEFAULT_CONNECT_TIMEOUT) + "\n"; #ifdef USE_UPNP #if USE_UPNP strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n"; @@ -641,12 +641,9 @@ bool AppInit2(boost::thread_group& threadGroup) bool fDisableWallet = GetBoolArg("-disablewallet", false); #endif - if (mapArgs.count("-timeout")) - { - int nNewTimeout = GetArg("-timeout", 5000); - if (nNewTimeout > 0 && nNewTimeout < 600000) - nConnectTimeout = nNewTimeout; - } + nConnectTimeout = GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT); + if (nConnectTimeout <= 0) + nConnectTimeout = DEFAULT_CONNECT_TIMEOUT; // Continue to put "/P2SH/" in the coinbase to monitor // BIP16 support. -- cgit v1.2.3