#include "ipcollector.h"
#include "ui_interface.h"
#include "checkpoints.h"
-#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/convenience.hpp>
fTaken = true;
}
}
- static bool fExit;
+ volatile static bool fExit;
if (fFirstThread)
{
fShutdown = true;
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
" -dblogsize=<n> " + _("Set database disk log size in megabytes (default: 100)") + "\n" +
" -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n" +
- " -proxy=<ip:port> " + _("Connect through socks proxy") + "\n" +
- " -socks=<n> " + _("Select the version of socks proxy to use (4-5, default: 5)") + "\n" +
+ " -proxy=<ip:port> " + _("Connect through socks5 proxy") + "\n" +
" -tor=<ip:port> " + _("Use proxy to reach tor hidden services (default: same as -proxy)") + "\n"
" -torname=<host.onion> " + _("Send the specified hidden service name when connecting to Tor nodes (default: none)") + "\n"
" -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" +
#endif
" -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n" +
- " -mininput=<amt> " + str(boost::format(_("When creating transactions, ignore inputs with value less than this (default: %s)")) % FormatMoney(MIN_TXOUT_AMOUNT)) + "\n" +
+ " -mininput=<amt> " + ((string)("When creating transactions, ignore inputs with value less than this (default: ") + FormatMoney(MIN_TXOUT_AMOUNT) + ")") + "\n" +
#ifdef QT_GUI
" -server " + _("Accept command line and JSON-RPC commands") + "\n" +
#endif
// Ping and address broadcast intervals
nPingInterval = max<int64_t>(10 * 60, GetArg("-keepalive", 30 * 60));
- CheckpointsMode = Checkpoints::STRICT;
+ CheckpointsMode = Checkpoints::CP_STRICT;
auto strCpMode = GetArg("-cppolicy", "strict");
if(strCpMode == "strict") {
- CheckpointsMode = Checkpoints::STRICT;
+ CheckpointsMode = Checkpoints::CP_STRICT;
}
if(strCpMode == "advisory") {
- CheckpointsMode = Checkpoints::ADVISORY;
+ CheckpointsMode = Checkpoints::CP_ADVISORY;
}
if(strCpMode == "permissive") {
- CheckpointsMode = Checkpoints::PERMISSIVE;
+ CheckpointsMode = Checkpoints::CP_PERMISSIVE;
}
fTestNet = GetBoolArg("-testnet");
printf("Startup time: %s\n", DateTimeStrFormat("%x %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());
- std::ostringstream strErrors;
if (fDaemon)
fprintf(stdout, "NovaCoin server starting\n");
NewThread(ThreadScriptCheck, NULL);
}
- int64_t nStart;
-
// ********************************************************* Step 5: verify database integrity
uiInterface.InitMessage(_("Verifying database integrity..."));
// ********************************************************* Step 6: network initialization
- int nSocksVersion = GetArgInt("-socks", 5);
-
- if (nSocksVersion != 4 && nSocksVersion != 5)
- return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion));
-
if (mapArgs.count("-onlynet")) {
std::set<enum Network> nets;
for(std::string snet : mapMultiArgs["-onlynet"]) {
SetLimited(net);
}
}
-#if defined(USE_IPV6)
-#if ! USE_IPV6
- else
- SetLimited(NET_IPV6);
-#endif
-#endif
CService addrProxy;
bool fProxy = false;
return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"].c_str()));
if (!IsLimited(NET_IPV4))
- SetProxy(NET_IPV4, addrProxy, nSocksVersion);
- if (nSocksVersion > 4) {
-#ifdef USE_IPV6
+ SetProxy(NET_IPV4, addrProxy);
if (!IsLimited(NET_IPV6))
- SetProxy(NET_IPV6, addrProxy, nSocksVersion);
-#endif
- SetNameProxy(addrProxy, nSocksVersion);
- }
+ SetProxy(NET_IPV6, addrProxy);
+ SetNameProxy(addrProxy);
fProxy = true;
}
addrOnion = CService(mapArgs["-tor"], nSocksDefault);
if (!addrOnion.IsValid())
return InitError(strprintf(_("Invalid -tor address: '%s'"), mapArgs["-tor"].c_str()));
- SetProxy(NET_TOR, addrOnion, 5);
+ SetProxy(NET_TOR, addrOnion);
SetReachable(NET_TOR);
}
// see Step 2: parameter interactions for more information about these
if (!IsLimited(NET_IPV4) || !IsLimited(NET_IPV6))
{
- fNoListen = !GetBoolArg("-listen", true);
+ fListen = GetBoolArg("-listen", true);
fDiscover = GetBoolArg("-discover", true);
fNameLookup = GetBoolArg("-dns", true);
} else {
// Don't listen, discover addresses or search for nodes if IPv4 and IPv6 networking is disabled.
- fNoListen = true;
+ fListen = false;
fDiscover = fNameLookup = false;
SoftSetBoolArg("-irc", false);
SoftSetBoolArg("-dnsseed", false);
}
bool fBound = false;
- if (!fNoListen)
+ if (fListen)
{
- std::string strError;
if (mapArgs.count("-bind")) {
for(std::string strBind : mapMultiArgs["-bind"]) {
CService addrBind;
} else {
struct in_addr inaddr_any;
inaddr_any.s_addr = INADDR_ANY;
-#ifdef USE_IPV6
if (!IsLimited(NET_IPV6))
fBound |= Bind(CService(in6addr_any, GetListenPort()), false);
-#endif
if (!IsLimited(NET_IPV4))
fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound);
struct in_addr inaddr_loopback;
inaddr_loopback.s_addr = htonl(INADDR_LOOPBACK);
-#ifdef USE_IPV6
if (!BindListenPort(CService(in6addr_loopback, GetListenPort()), strError))
return InitError(strError);
-#endif
if (!BindListenPort(CService(inaddr_loopback, GetListenPort()), strError))
return InitError(strError);
}
printf("Loading block index...\n");
bool fLoaded = false;
+ int64_t nStart;
while (!fLoaded) {
std::string strLoadError;
uiInterface.InitMessage(_("Loading block index..."));
for (auto mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
{
auto hash = (*mi).first;
- if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0)
+ if (strMatch.compare(hash.ToString()) == 0)
{
auto pindex = (*mi).second;
CBlock block;
uiInterface.InitMessage(_("Loading wallet..."));
printf("Loading wallet...\n");
nStart = GetTimeMillis();
+ std::ostringstream strErrors;
bool fFirstRun = true;
pwalletMain = new CWallet(strWalletFileName);
DBErrors nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun);