#endif
#include "init.h"
-#include "sodium.h"
-
+#include "crypto/common.h"
#include "addrman.h"
#include "amount.h"
#include "checkpoints.h"
#include "consensus/validation.h"
#include "key.h"
#include "main.h"
+#include "metrics.h"
#include "miner.h"
#include "net.h"
#include "rpcserver.h"
// shutdown thing.
//
-volatile bool fRequestShutdown = false;
+std::atomic<bool> fRequestShutdown(false);
void StartShutdown()
{
/// for example if the data directory was found to be locked.
/// Be sure that anything that writes files or flushes caches only does this if the respective
/// module was initialized.
- RenameThread("bitcoin-shutoff");
+ RenameThread("zcash-shutoff");
mempool.AddTransactionsUpdated(1);
StopRPCThreads();
#ifdef ENABLE_WALLET
delete pwalletMain;
pwalletMain = NULL;
#endif
+ delete pzcashParams;
+ pzcashParams = NULL;
ECC_Stop();
LogPrintf("%s: done\n", __func__);
}
strUsage += HelpMessageOpt("-blocknotify=<cmd>", _("Execute command when the best block changes (%s in cmd is replaced by block hash)"));
strUsage += HelpMessageOpt("-checkblocks=<n>", strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), 288));
strUsage += HelpMessageOpt("-checklevel=<n>", strprintf(_("How thorough the block verification of -checkblocks is (0-4, default: %u)"), 3));
- strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "zcash.conf"));
+ strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "komodo.conf"));
if (mode == HMM_BITCOIND)
{
#if !defined(WIN32)
strUsage += HelpMessageOpt("-par=<n>", strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"),
-(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS));
#ifndef WIN32
- strUsage += HelpMessageOpt("-pid=<file>", strprintf(_("Specify pid file (default: %s)"), "zcashd.pid"));
+ strUsage += HelpMessageOpt("-pid=<file>", strprintf(_("Specify pid file (default: %s)"), "komodod.pid"));
#endif
strUsage += HelpMessageOpt("-prune=<n>", strprintf(_("Reduce storage requirements by pruning (deleting) old blocks. This mode disables wallet support and is incompatible with -txindex. "
"Warning: Reverting this setting requires re-downloading the entire blockchain. "
strUsage += HelpMessageOpt("-whitebind=<addr>", _("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6"));
strUsage += HelpMessageOpt("-whitelist=<netmask>", _("Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.") +
" " + _("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway"));
-
#ifdef ENABLE_WALLET
strUsage += HelpMessageGroup(_("Wallet options:"));
#ifdef ENABLE_WALLET
strUsage += HelpMessageOpt("-gen", strprintf(_("Generate coins (default: %u)"), 0));
strUsage += HelpMessageOpt("-genproclimit=<n>", strprintf(_("Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)"), 1));
+ strUsage += HelpMessageOpt("-equihashsolver=<name>", _("Specify the Equihash solver to be used if enabled (default: \"default\")"));
#endif
strUsage += HelpMessageOpt("-help-debug", _("Show all debugging options (usage: --help -help-debug)"));
strUsage += HelpMessageOpt("-logips", strprintf(_("Include IP addresses in debug output (default: %u)"), 0));
strUsage += HelpMessageOpt("-rpcthreads=<n>", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), 4));
strUsage += HelpMessageOpt("-rpckeepalive", strprintf(_("RPC support for HTTP persistent connections (default: %d)"), 1));
+ // Disabled until we can lock notes and also tune performance of libsnark which by default uses multiple threads
+ //strUsage += HelpMessageOpt("-rpcasyncthreads=<n>", strprintf(_("Set the number of threads to service Async RPC calls (default: %d)"), 1));
+
strUsage += HelpMessageGroup(_("RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)"));
strUsage += HelpMessageOpt("-rpcssl", _("Use OpenSSL (https) for JSON-RPC connections"));
strUsage += HelpMessageOpt("-rpcsslcertificatechainfile=<file.cert>", strprintf(_("Server certificate file (default: %s)"), "server.cert"));
void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
{
- RenameThread("bitcoin-loadblk");
+ RenameThread("zcash-loadblk");
// -reindex
if (fReindex) {
+#ifdef ENABLE_WALLET
+ if (pwalletMain) {
+ pwalletMain->ClearNoteWitnessCache();
+ }
+#endif
CImportingNow imp;
int nFile = 0;
while (true) {
struct timeval tv_start, tv_end;
float elapsed;
- boost::filesystem::path pk_path = ZC_GetParamsDir() / "z7-proving.key";
- boost::filesystem::path vk_path = ZC_GetParamsDir() / "z7-verifying.key";
+ boost::filesystem::path pk_path = ZC_GetParamsDir() / "sprout-proving.key";
+ boost::filesystem::path vk_path = ZC_GetParamsDir() / "sprout-verifying.key";
pzcashParams = ZCJoinSplit::Unopened();
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
// Initialize libsodium
- if (sodium_init() == -1) {
+ if (init_and_check_sodium() == -1) {
return false;
}
// Sanity check
if (!InitSanityCheck())
- return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down."));
+ return InitError(_("Initialization sanity check failed. Zcash is shutting down."));
std::string strDataDir = GetDataDir().string();
#ifdef ENABLE_WALLET
try {
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock())
- return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running."), strDataDir));
+ return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Zcash is probably already running."), strDataDir));
} catch(const boost::interprocess::interprocess_exception& e) {
- return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running.") + " %s.", strDataDir, e.what()));
+ return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Zcash is probably already running.") + " %s.", strDataDir, e.what()));
}
#ifndef WIN32
if (GetBoolArg("-shrinkdebugfile", !fDebug))
ShrinkDebugFile();
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- LogPrintf("Bitcoin version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
+ LogPrintf("Zcash version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
LogPrintf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION));
#ifdef ENABLE_WALLET
LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(0, 0, 0));
CScheduler::Function serviceLoop = boost::bind(&CScheduler::serviceQueue, &scheduler);
threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>, "scheduler", serviceLoop));
+ if ((chainparams.NetworkIDString() != "regtest") &&
+ GetBoolArg("-showmetrics", false) &&
+ !fPrintToConsole && !GetBoolArg("-daemon", false)) {
+ // Start the persistent metrics interface
+ ConnectMetricsScreen();
+ threadGroup.create_thread(&ThreadShowMetricsScreen);
+ }
+
// Initialize Zcash circuit parameters
ZC_LoadParams();
// These must be disabled for now, they are buggy and we probably don't