#include "util.h"
#include "ui_interface.h"
#include "checkpoints.h"
-#include "zerocoin/ZeroTest.h"
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
std::string strWalletFileName;
bool fConfChange;
unsigned int nNodeLifespan;
-unsigned int nDerivationMethodIndex;
unsigned int nMinerSleep;
bool fUseFastIndex;
bool fUseFastStakeMiner;
bool fUseMemoryLog;
enum Checkpoints::CPMode CheckpointsMode;
+// Ping and address broadcast intervals
+extern int64_t nPingInterval;
+extern int64_t nBroadcastInterval;
+
//////////////////////////////////////////////////////////////////////////////
//
// Shutdown
fUseMemoryLog = GetBoolArg("-memorylog", true);
nMinerSleep = GetArg("-minersleep", 500);
+ // 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));
+
CheckpointsMode = Checkpoints::STRICT;
std::string strCpMode = GetArg("-cppolicy", "strict");
- if(strCpMode == "strict")
+ if(strCpMode == "strict") {
CheckpointsMode = Checkpoints::STRICT;
+ }
- if(strCpMode == "advisory")
+ if(strCpMode == "advisory") {
CheckpointsMode = Checkpoints::ADVISORY;
+ }
- if(strCpMode == "permissive")
+ if(strCpMode == "permissive") {
CheckpointsMode = Checkpoints::PERMISSIVE;
-
- nDerivationMethodIndex = 0;
+ }
fTestNet = GetBoolArg("-testnet");
if (fTestNet) {
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
std::string strDataDir = GetDataDir().string();
- std::string strWalletFileName = GetArg("-wallet", "wallet.dat");
+ strWalletFileName = GetArg("-wallet", "wallet.dat");
// strWalletFileName must be a plain filename without a directory
if (strWalletFileName != boost::filesystem::basename(strWalletFileName) + boost::filesystem::extension(strWalletFileName))
NewThread(ThreadScriptCheck, NULL);
}
- int64 nStart;
+ int64_t nStart;
// ********************************************************* Step 5: verify database integrity
if (mapArgs.count("-reservebalance")) // ppcoin: reserve balance amount
{
- int64 nReserveBalance = 0;
+ int64_t nReserveBalance = 0;
if (!ParseMoney(mapArgs["-reservebalance"], nReserveBalance))
{
InitError(_("Invalid amount for -reservebalance=<amount>"));
printf("Shutdown requested. Exiting.\n");
return false;
}
- printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);
+ printf(" block index %15" PRId64 "ms\n", GetTimeMillis() - nStart);
if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
{
return false;
}
- // ********************************************************* Testing Zerocoin
-
-
- if (GetBoolArg("-zerotest", false))
- {
- printf("\n=== ZeroCoin tests start ===\n");
- Test_RunAllTests();
- printf("=== ZeroCoin tests end ===\n\n");
- }
-
// ********************************************************* Step 8: load wallet
uiInterface.InitMessage(_("Loading wallet..."));
}
printf("%s", strErrors.str().c_str());
- printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
+ printf(" wallet %15" PRId64 "ms\n", GetTimeMillis() - nStart);
RegisterWallet(pwalletMain);
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
- printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
+ printf(" rescan %15" PRId64 "ms\n", GetTimeMillis() - nStart);
}
// ********************************************************* Step 9: import blocks
printf("Invalid or missing peers.dat; recreating\n");
}
- printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n",
+ printf("Loaded %i addresses from peers.dat %" PRId64 "ms\n",
addrman.size(), GetTimeMillis() - nStart);
// ********************************************************* Step 11: start node
RandAddSeedPerfmon();
//// debug print
- printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size());
+ printf("mapBlockIndex.size() = %" PRIszu "\n", mapBlockIndex.size());
printf("nBestHeight = %d\n", nBestHeight);
- printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain->setKeyPool.size());
- printf("mapWallet.size() = %"PRIszu"\n", pwalletMain->mapWallet.size());
- printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain->mapAddressBook.size());
+ printf("setKeyPool.size() = %" PRIszu "\n", pwalletMain->setKeyPool.size());
+ printf("mapWallet.size() = %" PRIszu "\n", pwalletMain->mapWallet.size());
+ printf("mapAddressBook.size() = %" PRIszu "\n", pwalletMain->mapAddressBook.size());
if (!NewThread(StartNode, NULL))
InitError(_("Error: could not start node"));