#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>
unsigned int nMinerSleep;
bool fUseFastIndex;
bool fUseFastStakeMiner;
+bool fUseMemoryLog;
enum Checkpoints::CPMode CheckpointsMode;
//////////////////////////////////////////////////////////////////////////////
nTransactionsUpdated++;
// CTxDB().Close();
bitdb.Flush(false);
- {
- LOCK(cs_main);
- ThreadScriptCheckQuit();
- }
StopNode();
bitdb.Flush(true);
boost::filesystem::remove(GetPidFile());
#endif
#endif
" -detachdb " + _("Detach block and address databases. Increases shutdown time (default: 0)") + "\n" +
+
+#ifdef DB_LOG_IN_MEMORY
+ " -memorylog " + _("Use in-memory logging for block index database (default: 1)") + "\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" +
#ifdef QT_GUI
nNodeLifespan = GetArg("-addrlifespan", 7);
fUseFastIndex = GetBoolArg("-fastindex", true);
+ fUseMemoryLog = GetBoolArg("-memorylog", true);
nMinerSleep = GetArg("-minersleep", 500);
CheckpointsMode = Checkpoints::STRICT;
// ********************************************************* 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
if (file)
LoadExternalBlockFile(file);
}
- exit(0);
+ StartShutdown();
}
filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat";
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"));