From 110257a631455ac7b5c15c027d00bc41c04a2478 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 30 Apr 2013 18:16:07 +0200 Subject: [PATCH] small init.cpp changes (strings / Winsock init) - add a check that requested Winsock version is available - update some strings - remove -gen=0 from help-message as this is default --- src/init.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 3845cfad..d82afd71 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -290,8 +290,7 @@ std::string HelpMessage() " -? " + _("This help message") + "\n" + " -conf= " + _("Specify configuration file (default: bitcoin.conf)") + "\n" + " -pid= " + _("Specify pid file (default: bitcoind.pid)") + "\n" + - " -gen " + _("Generate coins") + "\n" + - " -gen=0 " + _("Don't generate coins") + "\n" + + " -gen " + _("Generate coins (default: 0)") + "\n" + " -datadir= " + _("Specify data directory") + "\n" + " -dbcache= " + _("Set database cache size in megabytes (default: 25)") + "\n" + " -timeout= " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n" + @@ -358,7 +357,7 @@ std::string HelpMessage() " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" + " -loadblock= " + _("Imports blocks from external blk000??.dat file") + "\n" + " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" + - " -par=N " + _("Set the number of script verification threads (up to 16, 0=auto, negative=leave N CPUs free, default: 0)") + "\n" + + " -par= " + _("Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)") + "\n" + "\n" + _("Block creation options:") + "\n" + " -blockminsize= " + _("Set minimum block size in bytes (default: 0)") + "\n" + @@ -466,9 +465,9 @@ bool AppInit2(boost::thread_group& threadGroup) // Initialize Windows Sockets WSADATA wsadata; int ret = WSAStartup(MAKEWORD(2,2), &wsadata); - if (ret != NO_ERROR) + if (ret != NO_ERROR || LOBYTE(wsadata.wVersion ) != 2 || HIBYTE(wsadata.wVersion) != 2) { - return InitError(strprintf("Error: TCP/IP socket library failed to start (WSAStartup returned error %d)", ret)); + return InitError(strprintf("Error: Winsock library failed to start (WSAStartup returned error %d)", ret)); } #endif #ifndef WIN32 @@ -612,7 +611,7 @@ bool AppInit2(boost::thread_group& threadGroup) if (!fLogTimestamps) printf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str()); printf("Default data directory %s\n", GetDefaultDataDir().string().c_str()); - printf("Used data directory %s\n", strDataDir.c_str()); + printf("Using data directory %s\n", strDataDir.c_str()); printf("Using at most %i connections (%i file descriptors available)\n", nMaxConnections, nFD); std::ostringstream strErrors;