X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Finit.cpp;h=8ba1c61d8166792693252638c882a2975271e0fa;hb=5bb94e9d0b7e239ac7f4d2d7d31586e91bf1bf94;hp=ca7c8b1b638fe2c03cf1cee0a71ea8e22d67df84;hpb=52332d9954a3fb6589e7efb4c90ce0c15a3a3540;p=novacoin.git diff --git a/src/init.cpp b/src/init.cpp index ca7c8b1..8ba1c61 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -31,7 +31,6 @@ CClientUIInterface uiInterface; std::string strWalletFileName; bool fConfChange; unsigned int nNodeLifespan; -unsigned int nMinerSleep; bool fUseFastIndex; bool fUseMemoryLog; enum Checkpoints::CPMode CheckpointsMode; @@ -39,6 +38,7 @@ enum Checkpoints::CPMode CheckpointsMode; // Ping and address broadcast intervals extern int64_t nPingInterval; extern int64_t nBroadcastInterval; +extern int64_t nReserveBalance; ////////////////////////////////////////////////////////////////////////////// // @@ -252,7 +252,7 @@ std::string HelpMessage() " -connect= " + _("Connect only to the specified node(s)") + "\n" + " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + " -externalip= " + _("Specify your own public address") + "\n" + - " -onlynet= " + _("Only connect to nodes in network (IPv4, IPv6 or Tor)") + "\n" + + " -onlynet= " + _("Only connect to nodes in network (IPv4, IPv6 or Onion)") + "\n" + " -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n" + " -irc " + _("Find peers using internet relay chat (default: 1)") + "\n" + " -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n" + @@ -377,7 +377,6 @@ bool AppInit2() nNodeLifespan = (unsigned int)(GetArg("-addrlifespan", 7)); fUseFastIndex = GetBoolArg("-fastindex", true); fUseMemoryLog = GetBoolArg("-memorylog", true); - nMinerSleep = (unsigned int)(GetArg("-minersleep", 500)); // Ping and address broadcast intervals nPingInterval = max(10 * 60, GetArg("-keepalive", 30 * 60)); @@ -446,7 +445,7 @@ bool AppInit2() // ********************************************************* Step 3: parameter-to-internal-flags // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency - nScriptCheckThreads = (int)(GetArg("-par", 0)); + nScriptCheckThreads = GetArgInt("-par", 0); if (nScriptCheckThreads == 0) nScriptCheckThreads = boost::thread::hardware_concurrency(); if (nScriptCheckThreads <= 1) @@ -485,17 +484,13 @@ bool AppInit2() if (mapArgs.count("-timeout")) { - int nNewTimeout = (int)(GetArg("-timeout", 5000)); + int nNewTimeout = GetArgInt("-timeout", 5000); if (nNewTimeout > 0 && nNewTimeout < 600000) nConnectTimeout = nNewTimeout; } - // Continue to put "/P2SH/" in the coinbase to monitor - // BIP16 support. - // This can be removed eventually... - const char* pszP2SH = "/P2SH/"; - COINBASE_FLAGS << std::vector(pszP2SH, pszP2SH+strlen(pszP2SH)); - + // Put client version data into coinbase flags. + COINBASE_FLAGS << PROTOCOL_VERSION << DISPLAY_VERSION_MAJOR << DISPLAY_VERSION_MINOR << DISPLAY_VERSION_REVISION; if (mapArgs.count("-paytxfee")) { @@ -574,9 +569,6 @@ bool AppInit2() int64_t nStart; -#ifdef USE_SSE2 - scrypt_detect_sse2(); -#endif // ********************************************************* Step 5: verify database integrity uiInterface.InitMessage(_("Verifying database integrity...")); @@ -613,7 +605,7 @@ bool AppInit2() // ********************************************************* Step 6: network initialization - int nSocksVersion = (int)(GetArg("-socks", 5)); + int nSocksVersion = GetArgInt("-socks", 5); if (nSocksVersion != 4 && nSocksVersion != 5) return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion)); @@ -642,7 +634,7 @@ bool AppInit2() CService addrProxy; bool fProxy = false; if (mapArgs.count("-proxy")) { - addrProxy = CService(mapArgs["-proxy"], 9050); + addrProxy = CService(mapArgs["-proxy"], nSocksDefault); if (!addrProxy.IsValid()) return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"].c_str())); @@ -664,7 +656,7 @@ bool AppInit2() if (!mapArgs.count("-tor")) addrOnion = addrProxy; else - addrOnion = CService(mapArgs["-tor"], 9050); + addrOnion = CService(mapArgs["-tor"], nSocksDefault); if (!addrOnion.IsValid()) return InitError(strprintf(_("Invalid -tor address: '%s'"), mapArgs["-tor"].c_str())); SetProxy(NET_TOR, addrOnion, 5); @@ -741,7 +733,6 @@ bool AppInit2() if (mapArgs.count("-reservebalance")) // ppcoin: reserve balance amount { - int64_t nReserveBalance = 0; if (!ParseMoney(mapArgs["-reservebalance"], nReserveBalance)) { InitError(_("Invalid amount for -reservebalance=")); @@ -891,7 +882,7 @@ bool AppInit2() if (GetBoolArg("-upgradewallet", fFirstRun)) { - int nMaxVersion = (int)(GetArg("-upgradewallet", 0)); + int nMaxVersion = GetArgInt("-upgradewallet", 0); if (nMaxVersion == 0) // the -upgradewallet without argument case { printf("Performing wallet upgrade to %i\n", FEATURE_LATEST);