X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Finit.cpp;h=1ebb167cb174411d05e2ee75c863e9fb04ea3ce3;hb=d008ea3376606276a86ed3c972654363eb23f47d;hp=37c43a50c3a2416e7f50d4fb85fbb6f475c780b4;hpb=9a452adf035d90d341142ed0a164b4e716cdbe84;p=novacoin.git diff --git a/src/init.cpp b/src/init.cpp index 37c43a5..1ebb167 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -10,7 +10,6 @@ #include "util.h" #include "ui_interface.h" #include "checkpoints.h" -#include "zerocoin/ZeroTest.h" #include #include #include @@ -36,6 +35,7 @@ unsigned int nDerivationMethodIndex; unsigned int nMinerSleep; bool fUseFastIndex; bool fUseFastStakeMiner; +bool fUseMemoryLog; enum Checkpoints::CPMode CheckpointsMode; ////////////////////////////////////////////////////////////////////////////// @@ -68,7 +68,7 @@ void Shutdown(void* parg) static bool fTaken; // Make this thread recognisable as the shutdown thread - RenameThread("bitcoin-shutoff"); + RenameThread("novacoin-shutoff"); bool fFirstThread = false; { @@ -267,6 +267,11 @@ std::string HelpMessage() #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= " + _("Fee per KB to add to transactions you send") + "\n" + " -mininput= " + str(boost::format(_("When creating transactions, ignore inputs with value less than this (default: %s)")) % FormatMoney(MIN_TXOUT_AMOUNT)) + "\n" + #ifdef QT_GUI @@ -298,6 +303,7 @@ std::string HelpMessage() " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + "\n" + " -checkblocks= " + _("How many blocks to check at startup (default: 2500, 0 = all)") + "\n" + " -checklevel= " + _("How thorough the block verification is (0-6, default: 1)") + "\n" + + " -par=N " + _("Set the number of script verification threads (1-16, 0=auto, default: 0)") + "\n" + " -loadblock= " + _("Imports blocks from external blk000?.dat file") + "\n" + "\n" + _("Block creation options:") + "\n" + @@ -365,6 +371,7 @@ bool AppInit2() nNodeLifespan = GetArg("-addrlifespan", 7); fUseFastIndex = GetBoolArg("-fastindex", true); + fUseMemoryLog = GetBoolArg("-memorylog", true); nMinerSleep = GetArg("-minersleep", 500); CheckpointsMode = Checkpoints::STRICT; @@ -421,6 +428,15 @@ bool AppInit2() // ********************************************************* Step 3: parameter-to-internal-flags + // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency + nScriptCheckThreads = GetArg("-par", 0); + if (nScriptCheckThreads == 0) + nScriptCheckThreads = boost::thread::hardware_concurrency(); + if (nScriptCheckThreads <= 1) + nScriptCheckThreads = 0; + else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS) + nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; + fDebug = GetBoolArg("-debug"); // -debug implies fDebug* @@ -533,6 +549,12 @@ bool AppInit2() if (fDaemon) fprintf(stdout, "NovaCoin server starting\n"); + if (nScriptCheckThreads) { + printf("Using %u threads for script verification\n", nScriptCheckThreads); + for (int i=0; inHeight - pindexRescan->nHeight, pindexRescan->nHeight); nStart = GetTimeMillis(); pwalletMain->ScanForWalletTransactions(pindexRescan, true); - printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); + printf(" rescan %15" PRI64d "ms\n", GetTimeMillis() - nStart); } // ********************************************************* Step 9: import blocks @@ -860,7 +872,7 @@ bool AppInit2() if (file) LoadExternalBlockFile(file); } - exit(0); + StartShutdown(); } filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; @@ -887,7 +899,7 @@ bool AppInit2() 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 %" PRI64d "ms\n", addrman.size(), GetTimeMillis() - nStart); // ********************************************************* Step 11: start node @@ -898,11 +910,11 @@ bool AppInit2() 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"));