#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
}
return true;
}
- catch(std::exception &e)
+ catch(const std::exception&)
{
// TODO: report error here
return false;
}
}
-/** Initialize bitcoin.
- * @pre Parameters should be parsed and config file should be read.
- */
+// Initialize bitcoin.
+// @pre Parameters should be parsed and config file should be read.
bool AppInit2()
{
// ********************************************************* Step 1: setup
// 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"]) {
return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"].c_str()));
if (!IsLimited(NET_IPV4))
- SetProxy(NET_IPV4, addrProxy, nSocksVersion);
- if (nSocksVersion > 4) {
+ SetProxy(NET_IPV4, addrProxy);
#ifdef USE_IPV6
if (!IsLimited(NET_IPV6))
- SetProxy(NET_IPV6, addrProxy, nSocksVersion);
+ SetProxy(NET_IPV6, addrProxy);
#endif
- SetNameProxy(addrProxy, nSocksVersion);
- }
+ 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);
}
bool fBound = false;
if (!fNoListen)
{
- std::string strError;
if (mapArgs.count("-bind")) {
for(std::string strBind : mapMultiArgs["-bind"]) {
CService addrBind;
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);