#include "net.h"
#include "init.h"
#include "util.h"
-#include "ntp.h"
#include "ui_interface.h"
#include "checkpoints.h"
#include <boost/format.hpp>
" -connect=<ip> " + _("Connect only to the specified node(s)") + "\n" +
" -seednode=<ip> " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" +
" -externalip=<ip> " + _("Specify your own public address") + "\n" +
- " -onlynet=<net> " + _("Only connect to nodes in network <net> (IPv4, IPv6 or Tor)") + "\n" +
+ " -onlynet=<net> " + _("Only connect to nodes in network <net> (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" +
// Ping and address broadcast intervals
nPingInterval = max<int64_t>(10 * 60, GetArg("-keepalive", 30 * 60));
-
- nBroadcastInterval = max<int64_t>(6 * 60 * 60, GetArg("-addrsetlifetime", 24 * 60 * 60));
+ nBroadcastInterval = max<int64_t>(6 * 60 * 60, GetArg("-addrsetlifetime", nOneDay));
CheckpointsMode = Checkpoints::STRICT;
std::string strCpMode = GetArg("-cppolicy", "strict");
// ********************************************************* 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)
if (mapArgs.count("-timeout"))
{
- int nNewTimeout = (int)(GetArg("-timeout", 5000));
+ int nNewTimeout = GetArgInt("-timeout", 5000);
if (nNewTimeout > 0 && nNewTimeout < 600000)
nConnectTimeout = nNewTimeout;
}
// ********************************************************* 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));
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);
if (fServer)
NewThread(ThreadRPCServer, NULL);
- // ********************************************************* Step 12: add time data from four random NTP servers.
- uiInterface.InitMessage(_("Synchronizing time through NTP..."));
- printf("Synchronizing time through NTP...\n");
- int i = 0;
- while(i < 4) {
- CNetAddr ip;
- int64_t nTime = NtpGetTime(ip);
-
- if (nTime > 0 && nTime != 2085978496) { // Skip the deliberately wrong timestamps
- AddTimeData(ip, nTime);
- printf("AddTimeData(%s, %" PRId64 ")\n", ip.ToString().c_str(), nTime);
- }
-
- i++;
- }
- uiInterface.InitMessage(_("Done"));
- printf("Done\n");
// ********************************************************* Step 12: finished
uiInterface.InitMessage(_("Done loading"));