7 #if defined(HAVE_CONFIG_H) 74 #include <boost/algorithm/string/classification.hpp> 75 #include <boost/algorithm/string/predicate.hpp> 76 #include <boost/algorithm/string/replace.hpp> 77 #include <boost/algorithm/string/split.hpp> 78 #include <boost/bind.hpp> 79 #include <boost/filesystem.hpp> 80 #include <boost/function.hpp> 81 #include <boost/interprocess/sync/file_lock.hpp> 82 #include <boost/thread.hpp> 83 #include <openssl/crypto.h> 116 #define MIN_CORE_FILEDESCRIPTORS 0 118 #define MIN_CORE_FILEDESCRIPTORS 150 180 }
catch(
const std::runtime_error& e) {
182 LogPrintf(
"Error reading from database: %s\n", e.what());
206 threadGroup.interrupt_all();
214 LogPrintf(
"%s: In progress...\n", __func__);
216 TRY_LOCK(cs_Shutdown, lockShutdown);
256 if (!est_fileout.
IsNull())
259 LogPrintf(
"%s: Failed to write fee estimates to %s\n", __func__, est_path.string());
283 if (pzmqNotificationInterface) {
285 delete pzmqNotificationInterface;
286 pzmqNotificationInterface = NULL;
299 }
catch (
const boost::filesystem::filesystem_error& e) {
300 LogPrintf(
"%s: Unable to remove pidfile: %s\n", __func__, e.what());
360 std::string strError;
386 const bool showDebug =
GetBoolArg(
"-help-debug",
false);
394 strUsage +=
HelpMessageOpt(
"-alertnotify=<cmd>",
_(
"Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)"));
395 strUsage +=
HelpMessageOpt(
"-blocknotify=<cmd>",
_(
"Execute command when the best block changes (%s in cmd is replaced by block hash)"));
403 strUsage +=
HelpMessageOpt(
"-daemon",
_(
"Run in the background as a daemon and accept commands"));
406 strUsage +=
HelpMessageOpt(
"-datadir=<dir>",
_(
"Specify data directory"));
408 strUsage +=
HelpMessageOpt(
"-loadblock=<file>",
_(
"Imports blocks from external blk000??.dat file on startup"));
412 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)"),
417 strUsage +=
HelpMessageOpt(
"-prune=<n>",
strprintf(
_(
"Reduce storage requirements by pruning (deleting) old blocks. This mode is incompatible with -txindex and -rescan. " 418 "Warning: Reverting this setting requires re-downloading the entire blockchain. " 420 strUsage +=
HelpMessageOpt(
"-reindex-chainstate",
_(
"Rebuild chain state from the currently indexed blocks"));
421 strUsage +=
HelpMessageOpt(
"-reindex",
_(
"Rebuild chain state and block index from the blk*.dat files on disk"));
423 strUsage +=
HelpMessageOpt(
"-sysperms",
_(
"Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)"));
432 strUsage +=
HelpMessageOpt(
"-addnode=<ip>",
_(
"Add a node to connect to and attempt to keep the connection open"));
435 strUsage +=
HelpMessageOpt(
"-bind=<addr>",
_(
"Bind to given address and always listen on it. Use [host]:port notation for IPv6"));
436 strUsage +=
HelpMessageOpt(
"-connect=<ip>",
_(
"Connect only to the specified node(s)"));
437 strUsage +=
HelpMessageOpt(
"-discover",
_(
"Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)"));
439 strUsage +=
HelpMessageOpt(
"-dnsseed",
_(
"Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)"));
440 strUsage +=
HelpMessageOpt(
"-externalip=<ip>",
_(
"Specify your own public address"));
442 strUsage +=
HelpMessageOpt(
"-listen",
_(
"Accept connections from outside (default: 1 if no -proxy or -connect)"));
447 strUsage +=
HelpMessageOpt(
"-onion=<ip:port>",
strprintf(
_(
"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"),
"-proxy"));
448 strUsage +=
HelpMessageOpt(
"-onlynet=<net>",
_(
"Only connect to nodes in network <net> (ipv4, ipv6 or onion)"));
450 strUsage +=
HelpMessageOpt(
"-peerbloomfilters",
strprintf(
_(
"Support filtering of blocks and transaction with bloom filters (default: %u)"), 1));
452 strUsage +=
HelpMessageOpt(
"-enforcenodebloom",
strprintf(
"Enforce minimum protocol version to limit use of bloom filters (default: %u)", 0));
454 strUsage +=
HelpMessageOpt(
"-proxy=<ip:port>",
_(
"Connect through SOCKS5 proxy"));
456 strUsage +=
HelpMessageOpt(
"-seednode=<ip>",
_(
"Connect to a node to retrieve peer addresses, and disconnect"));
459 strUsage +=
HelpMessageOpt(
"-torpassword=<pass>",
_(
"Tor control port password (default: empty)"));
462 strUsage +=
HelpMessageOpt(
"-upnp",
_(
"Use UPnP to map the listening port (default: 1 when listening and no -proxy)"));
467 strUsage +=
HelpMessageOpt(
"-whitebind=<addr>",
_(
"Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6"));
468 strUsage +=
HelpMessageOpt(
"-whitelist=<netmask>",
_(
"Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.") +
469 " " +
_(
"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"));
476 strUsage +=
HelpMessageOpt(
"-disablewallet",
_(
"Do not load the wallet and disable wallet RPC calls"));
478 strUsage +=
HelpMessageOpt(
"-fallbackfee=<amt>",
strprintf(
_(
"A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)"),
480 strUsage +=
HelpMessageOpt(
"-mintxfee=<amt>",
strprintf(
_(
"Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)"),
482 strUsage +=
HelpMessageOpt(
"-paytxfee=<amt>",
strprintf(
_(
"Fee (in %s/kB) to add to transactions you send (default: %s)"),
484 strUsage +=
HelpMessageOpt(
"-rescan",
_(
"Rescan the block chain for missing wallet transactions on startup"));
485 strUsage +=
HelpMessageOpt(
"-salvagewallet",
_(
"Attempt to recover private keys from a corrupt wallet.dat on startup"));
489 strUsage +=
HelpMessageOpt(
"-maxtxfee=<amt>",
strprintf(
_(
"Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s)"),
492 strUsage +=
HelpMessageOpt(
"-mnemonic",
_(
"User defined mnemonic for HD wallet (bip39). Only has effect during wallet creation/first start (default: randomly generated)"));
493 strUsage +=
HelpMessageOpt(
"-mnemonicpassphrase",
_(
"User defined mnemonic passphrase for HD wallet (bip39). Only has effect during wallet creation/first start (default: empty string)"));
494 strUsage +=
HelpMessageOpt(
"-hdseed",
_(
"User defined seed for HD wallet (should be in hex). Only has effect during wallet creation/first start (default: randomly generated)"));
495 strUsage +=
HelpMessageOpt(
"-upgradewallet",
_(
"Upgrade wallet to latest format on startup"));
496 strUsage +=
HelpMessageOpt(
"-wallet=<file>",
_(
"Specify wallet file (within data directory)") +
" " +
strprintf(
_(
"(default: %s)"),
"wallet.dat"));
498 strUsage +=
HelpMessageOpt(
"-walletnotify=<cmd>",
_(
"Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)"));
499 strUsage +=
HelpMessageOpt(
"-zapwallettxes=<mode>",
_(
"Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup") +
500 " " +
_(
"(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)"));
502 strUsage +=
HelpMessageOpt(
"-walletbackupsdir=<dir>",
_(
"Specify full path to directory for automatic wallet backups (must exist)"));
503 strUsage +=
HelpMessageOpt(
"-keepass",
strprintf(
_(
"Use KeePass 2 integration using KeePassHttp plugin (default: %u)"), 0));
505 strUsage +=
HelpMessageOpt(
"-keepasskey=<key>",
_(
"KeePassHttp key for AES encrypted communication with KeePass"));
506 strUsage +=
HelpMessageOpt(
"-keepassid=<name>",
_(
"KeePassHttp id for the established association"));
507 strUsage +=
HelpMessageOpt(
"-keepassname=<name>",
_(
"Name to construct url for KeePass entry that stores the wallet passphrase"));
509 strUsage +=
HelpMessageOpt(
"-windowtitle=<name>",
_(
"Wallet window title"));
514 strUsage +=
HelpMessageOpt(
"-zmqpubhashblock=<address>",
_(
"Enable publish hash block in <address>"));
515 strUsage +=
HelpMessageOpt(
"-zmqpubhashtx=<address>",
_(
"Enable publish hash transaction in <address>"));
516 strUsage +=
HelpMessageOpt(
"-zmqpubhashtxlock=<address>",
_(
"Enable publish hash transaction (locked via InstantSend) in <address>"));
517 strUsage +=
HelpMessageOpt(
"-zmqpubrawblock=<address>",
_(
"Enable publish raw block in <address>"));
518 strUsage +=
HelpMessageOpt(
"-zmqpubrawtx=<address>",
_(
"Enable publish raw transaction in <address>"));
519 strUsage +=
HelpMessageOpt(
"-zmqpubrawtxlock=<address>",
_(
"Enable publish raw transaction (locked via InstantSend) in <address>"));
523 strUsage +=
HelpMessageOpt(
"-uacomment=<cmt>",
_(
"Append comment to the user agent string"));
528 strUsage +=
HelpMessageOpt(
"-checkblockindex",
strprintf(
"Do a full consistency check for mapBlockIndex, setBlockIndexCandidates, chainActive and mapBlocksUnlinked occasionally. Also sets -checkmempool (default: %u)",
Params(
CBaseChainParams::MAIN).DefaultConsistencyChecks()));
536 strUsage +=
HelpMessageOpt(
"-dropmessagestest=<n>",
"Randomly drop 1 of every <n> network messages");
537 strUsage +=
HelpMessageOpt(
"-fuzzmessagestest=<n>",
"Randomly fuzz 1 of every <n> network messages");
547 string debugCategories =
"addrman, alert, bench, coindb, db, http, libevent, lock, mempool, mempoolrej, net, proxy, prune, rand, reindex, rpc, selectcoins, tor, zmq, " 548 "dash (or specifically: gobject, instantsend, keepass, masternode, mnpayments, mnsync, privatesend, spork)";
550 debugCategories +=
", qt";
551 strUsage +=
HelpMessageOpt(
"-debug=<category>",
strprintf(
_(
"Output debugging information (default: %u, supplying <category> is optional)"), 0) +
". " +
552 _(
"If <category> is not supplied or if <category> = 1, output all debugging information.") +
_(
"<category> can be:") +
" " + debugCategories +
".");
554 strUsage +=
HelpMessageOpt(
"-nodebug",
"Turn off debugging messages, same as -debug=0");
557 strUsage +=
HelpMessageOpt(
"-help-debug",
_(
"Show all debugging options (usage: --help -help-debug)"));
564 strUsage +=
HelpMessageOpt(
"-mocktime=<n>",
"Replace actual time with <n> seconds since epoch (default: 0)");
569 strUsage +=
HelpMessageOpt(
"-minrelaytxfee=<amt>",
strprintf(
_(
"Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)"),
571 strUsage +=
HelpMessageOpt(
"-printtoconsole",
_(
"Send trace/debug info to console instead of debug.log file"));
572 strUsage +=
HelpMessageOpt(
"-printtodebuglog",
strprintf(
_(
"Send trace/debug info to debug.log file (default: %u)"), 1));
580 strUsage +=
HelpMessageOpt(
"-shrinkdebugfile",
_(
"Shrink debug.log file on client startup (default: 1 when no -debug)"));
582 strUsage +=
HelpMessageOpt(
"-litemode=<n>",
strprintf(
_(
"Disable all Dash specific functionality (Masternodes, PrivateSend, InstantSend, Governance) (0-1, default: %u)"), 0));
585 strUsage +=
HelpMessageOpt(
"-masternode=<n>",
strprintf(
_(
"Enable the client to act as a masternode (0-1, default: %u)"), 0));
586 strUsage +=
HelpMessageOpt(
"-mnconf=<file>",
strprintf(
_(
"Specify masternode configuration file (default: %s)"),
"masternode.conf"));
587 strUsage +=
HelpMessageOpt(
"-mnconflock=<n>",
strprintf(
_(
"Lock masternodes from masternode configuration file (default: %u)"), 1));
588 strUsage +=
HelpMessageOpt(
"-masternodeprivkey=<n>",
_(
"Set the masternode private key"));
591 strUsage +=
HelpMessageOpt(
"-enableprivatesend=<n>",
strprintf(
_(
"Enable use of automated PrivateSend for funds stored in this wallet (0-1, default: %u)"), 0));
595 strUsage +=
HelpMessageOpt(
"-liquidityprovider=<n>",
strprintf(
_(
"Provide liquidity to PrivateSend by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"),
DEFAULT_PRIVATESEND_LIQUIDITY));
598 strUsage +=
HelpMessageOpt(
"-enableinstantsend=<n>",
strprintf(
_(
"Enable InstantSend, show confirmations for locked transactions (0-1, default: %u)"), 1));
600 strUsage +=
HelpMessageOpt(
"-instantsendnotify=<cmd>",
_(
"Execute command when a wallet InstantSend transaction is successfully locked (%s in cmd is replaced by TxID)"));
616 strUsage +=
HelpMessageOpt(
"-blockversion=<n>",
"Override block version to test forking scenarios");
619 strUsage +=
HelpMessageOpt(
"-server",
_(
"Accept command line and JSON-RPC commands"));
621 strUsage +=
HelpMessageOpt(
"-rpcbind=<addr>",
_(
"Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)"));
622 strUsage +=
HelpMessageOpt(
"-rpccookiefile=<loc>",
_(
"Location of the auth cookie (default: data dir)"));
623 strUsage +=
HelpMessageOpt(
"-rpcuser=<user>",
_(
"Username for JSON-RPC connections"));
624 strUsage +=
HelpMessageOpt(
"-rpcpassword=<pw>",
_(
"Password for JSON-RPC connections"));
625 strUsage +=
HelpMessageOpt(
"-rpcauth=<userpw>",
_(
"Username and hashed password for JSON-RPC connections. The field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical python script is included in share/rpcuser. This option can be specified multiple times"));
627 strUsage +=
HelpMessageOpt(
"-rpcallowip=<ip>",
_(
"Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"));
646 FormatParagraph(
_(
"Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.")) +
"\n" +
648 FormatParagraph(
_(
"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.")) +
654 if (initialSync || !pBlockIndex)
657 std::string strCmd =
GetArg(
"-blocknotify",
"");
685 using namespace boost::filesystem;
686 map<string, path> mapBlockFiles;
691 LogPrintf(
"Removing unusable blk?????.dat and rev?????.dat files for -reindex with -prune\n");
693 for (directory_iterator it(blocksdir); it != directory_iterator(); it++) {
694 if (is_regular_file(*it) &&
695 it->path().filename().string().length() == 12 &&
696 it->path().filename().string().substr(8,4) ==
".dat")
698 if (it->path().filename().string().substr(0,3) ==
"blk")
699 mapBlockFiles[it->path().filename().string().substr(3,5)] = it->path();
700 else if (it->path().filename().string().substr(0,3) ==
"rev")
709 int nContigCounter = 0;
710 BOOST_FOREACH(
const PAIRTYPE(
string, path)& item, mapBlockFiles) {
711 if (
atoi(item.first) == nContigCounter) {
735 LogPrintf(
"Reindexing block file blk%05u.dat...\n", (
unsigned int)nFile);
747 boost::filesystem::path pathBootstrap =
GetDataDir() /
"bootstrap.dat";
748 if (boost::filesystem::exists(pathBootstrap)) {
749 FILE *
file = fopen(pathBootstrap.string().c_str(),
"rb");
751 boost::filesystem::path pathBootstrapOld =
GetDataDir() /
"bootstrap.dat.old";
752 LogPrintf(
"Importing bootstrap.dat...\n");
756 LogPrintf(
"Warning: Could not open bootstrap file %s\n", pathBootstrap.string());
761 BOOST_FOREACH(
const boost::filesystem::path& path, vImportFiles) {
762 FILE *
file = fopen(path.string().c_str(),
"rb");
764 LogPrintf(
"Importing blocks file %s...\n", path.string());
767 LogPrintf(
"Warning: Could not open blocks file %s\n", path.string());
774 LogPrintf(
"Failed to connect best block");
779 LogPrintf(
"Stopping after block import\n");
791 InitError(
"Elliptic curve cryptography sanity check failure. Aborting.");
824 LogPrintf(
"%s: parameter interaction: -bind set -> setting -listen=1\n", __func__);
826 if (
mapArgs.count(
"-whitebind")) {
828 LogPrintf(
"%s: parameter interaction: -whitebind set -> setting -listen=1\n", __func__);
834 LogPrintf(
"%s: parameter interaction: -masternode=1 -> setting -listen=1\n", __func__);
840 LogPrintf(
"%s: parameter interaction: -connect set -> setting -dnsseed=0\n", __func__);
842 LogPrintf(
"%s: parameter interaction: -connect set -> setting -listen=0\n", __func__);
848 LogPrintf(
"%s: parameter interaction: -proxy set -> setting -listen=0\n", __func__);
852 LogPrintf(
"%s: parameter interaction: -proxy set -> setting -upnp=0\n", __func__);
855 LogPrintf(
"%s: parameter interaction: -proxy set -> setting -discover=0\n", __func__);
861 LogPrintf(
"%s: parameter interaction: -listen=0 -> setting -upnp=0\n", __func__);
863 LogPrintf(
"%s: parameter interaction: -listen=0 -> setting -discover=0\n", __func__);
865 LogPrintf(
"%s: parameter interaction: -listen=0 -> setting -listenonion=0\n", __func__);
868 if (
mapArgs.count(
"-externalip")) {
871 LogPrintf(
"%s: parameter interaction: -externalip set -> setting -discover=0\n", __func__);
877 LogPrintf(
"%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
883 LogPrintf(
"%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__);
889 LogPrintf(
"%s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\n", __func__);
892 LogPrintf(
"%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
899 LogPrintf(
"%s: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1\n", __func__);
904 LogPrintf(
"%s: parameter interaction: -enableinstantsend=false -> setting -nInstantSendDepth=0\n", __func__);
908 if (nLiqProvTmp > 0) {
909 mapArgs[
"-enableprivatesend"] =
"1";
910 LogPrintf(
"%s: parameter interaction: -liquidityprovider=%d -> setting -enableprivatesend=1\n", __func__, nLiqProvTmp);
911 mapArgs[
"-privatesendrounds"] =
"99999";
912 LogPrintf(
"%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendrounds=99999\n", __func__, nLiqProvTmp);
913 mapArgs[
"-privatesendamount"] =
"999999";
914 LogPrintf(
"%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendamount=999999\n", __func__, nLiqProvTmp);
915 mapArgs[
"-privatesendmultisession"] =
"0";
916 LogPrintf(
"%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendmultisession=0\n", __func__, nLiqProvTmp);
921 mapArgs.erase(
"-mnemonicpassphrase");
922 LogPrintf(
"%s: parameter interaction: can't use -hdseed and -mnemonic/-mnemonicpassphrase together, will prefer -seed\n", __func__);
935 LogPrintf(
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
947 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
948 _CrtSetReportFile(_CRT_WARN, CreateFileA(
"NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));
952 _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
958 #ifndef PROCESS_DEP_ENABLE 961 #define PROCESS_DEP_ENABLE 0x00000001 963 typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD);
964 PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA(
"Kernel32.dll"),
"SetProcessDEPPolicy");
965 if (setProcDEPPol != NULL) setProcDEPPol(PROCESS_DEP_ENABLE);
969 return InitError(
"Initializing networking failed");
975 return InitError(
"-sysperms is not allowed in combination with enabled wallet functionality");
984 sigemptyset(&sa.sa_mask);
986 sigaction(SIGTERM, &sa, NULL);
987 sigaction(SIGINT, &sa, NULL);
990 struct sigaction sa_hup;
992 sigemptyset(&sa_hup.sa_mask);
994 sigaction(SIGHUP, &sa_hup, NULL);
997 signal(SIGPIPE, SIG_IGN);
1006 if (
GetArg(
"-prune", 0)) {
1008 return InitError(
_(
"Prune mode is incompatible with -txindex."));
1009 #ifdef ENABLE_WALLET 1011 return InitError(
_(
"Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
1017 int nBind = std::max((
int)
mapArgs.count(
"-bind") + (int)
mapArgs.count(
"-whitebind"), 1);
1019 int nMaxConnections = std::max(nUserMaxConnections, 0);
1025 return InitError(
_(
"Not enough file descriptors available."));
1028 if (nMaxConnections < nUserMaxConnections)
1029 InitWarning(
strprintf(
_(
"Reducing -maxconnections from %d to %d, because of system limitations."), nUserMaxConnections, nMaxConnections));
1035 const vector<string>& categories =
mapMultiArgs[
"-debug"];
1036 if (
GetBoolArg(
"-nodebug",
false) || find(categories.begin(), categories.end(), string(
"0")) != categories.end())
1041 InitWarning(
_(
"Unsupported argument -debugnet ignored, use -debug=net."));
1044 return InitError(
_(
"Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported."));
1047 return InitError(
_(
"Unsupported argument -tor found, use -onion."));
1050 InitWarning(
_(
"Unsupported argument -benchmark ignored, use -debug=bench."));
1052 if (
GetBoolArg(
"-whitelistalwaysrelay",
false))
1053 InitWarning(
_(
"Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay."));
1067 LogPrintf(
"Validating signatures for all blocks.\n");
1072 if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
1073 return InitError(
strprintf(
_(
"-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000000.0)));
1087 int64_t nSignedPruneTarget =
GetArg(
"-prune", 0) * 1024 * 1024;
1088 if (nSignedPruneTarget < 0) {
1089 return InitError(
_(
"Prune cannot be configured with a negative value."));
1096 LogPrintf(
"Prune configured to target %uMiB on disk for block and undo files.\n",
nPruneTarget / 1024 / 1024);
1100 #ifdef ENABLE_WALLET 1101 bool fDisableWallet =
GetBoolArg(
"-disablewallet",
false);
1114 if (
mapArgs.count(
"-minrelaytxfee"))
1128 #ifdef ENABLE_WALLET 1129 if (
mapArgs.count(
"-mintxfee"))
1137 if (
mapArgs.count(
"-fallbackfee"))
1143 InitWarning(
_(
"-fallbackfee is set very high! This is the transaction fee you may pay when fee estimates are not available."));
1146 if (
mapArgs.count(
"-paytxfee"))
1152 InitWarning(
_(
"-paytxfee is set very high! This is the transaction fee you will pay if you send a transaction."));
1156 return InitError(
strprintf(
_(
"Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)"),
1160 if (
mapArgs.count(
"-maxtxfee"))
1166 InitWarning(
_(
"-maxtxfee is set very high! Fees this large could be paid on a single transaction."));
1170 return InitError(
strprintf(
_(
"Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"),
1178 std::string strWalletFile =
GetArg(
"-wallet",
"wallet.dat");
1179 #endif // ENABLE_WALLET 1199 std::string strReplacementModeList =
GetArg(
"-mempoolreplacement",
"");
1200 std::vector<std::string> vstrReplacementModes;
1201 boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(
","));
1202 fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(),
"fee") != vstrReplacementModes.end());
1216 return InitError(
_(
"Initialization sanity check failed. Dash Core is shutting down."));
1218 std::string strDataDir =
GetDataDir().string();
1219 #ifdef ENABLE_WALLET 1222 return InitError(
strprintf(
_(
"Wallet %s resides outside data directory %s"), strWalletFile, strDataDir));
1225 boost::filesystem::path pathLockFile =
GetDataDir() /
".lock";
1226 FILE*
file = fopen(pathLockFile.string().c_str(),
"a");
1230 static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
1232 if (!lock.timed_lock(boost::get_system_time() + boost::posix_time::seconds(10)))
1233 return InitError(
strprintf(
_(
"Cannot obtain a lock on data directory %s. Dash Core is probably already running."), strDataDir));
1234 }
catch(
const boost::interprocess::interprocess_exception& e) {
1235 return InitError(
strprintf(
_(
"Cannot obtain a lock on data directory %s. Dash Core is probably already running.") +
" %s.", strDataDir, e.what()));
1250 #ifdef ENABLE_WALLET 1256 LogPrintf(
"Using data directory %s\n", strDataDir);
1258 LogPrintf(
"Using at most %i connections (%i file descriptors available)\n", nMaxConnections, nFD);
1259 std::ostringstream strErrors;
1267 if (
mapArgs.count(
"-sporkkey"))
1270 return InitError(
_(
"Unable to sign spork message, wrong key?"));
1275 threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>,
"scheduler", serviceLoop));
1286 return InitError(
_(
"Unable to start HTTP server. See debug log for details."));
1292 #ifdef ENABLE_WALLET 1293 if (!fDisableWallet) {
1294 std::string strWarning;
1295 std::string strError;
1301 if (!strWarning.empty())
1303 if (!strError.empty())
1307 LogPrintf(
"Using wallet %s\n", strWalletFile);
1316 if (!strWarning.empty())
1318 if (!strError.empty())
1326 #endif // ENABLE_WALLET 1342 std::vector<string> uacomments;
1346 return InitError(
strprintf(
_(
"User Agent comment (%s) contains unsafe characters."), cmt));
1351 return InitError(
strprintf(
_(
"Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments."),
1355 if (
mapArgs.count(
"-onlynet")) {
1356 std::set<enum Network> nets;
1357 BOOST_FOREACH(
const std::string& snet,
mapMultiArgs[
"-onlynet"]) {
1365 if (!nets.count(net))
1370 if (
mapArgs.count(
"-whitelist")) {
1371 BOOST_FOREACH(
const std::string& net,
mapMultiArgs[
"-whitelist"]) {
1376 connman.AddWhitelistedRange(subnet);
1383 std::string proxyArg =
GetArg(
"-proxy",
"");
1385 if (proxyArg !=
"" && proxyArg !=
"0") {
1401 std::string onionArg =
GetArg(
"-onion",
"");
1402 if (onionArg !=
"") {
1403 if (onionArg ==
"0") {
1421 bool fBound =
false;
1424 BOOST_FOREACH(
const std::string& strBind,
mapMultiArgs[
"-bind"]) {
1430 BOOST_FOREACH(
const std::string& strBind,
mapMultiArgs[
"-whitebind"]) {
1432 if (!
Lookup(strBind.c_str(), addrBind, 0,
false))
1440 struct in_addr inaddr_any;
1441 inaddr_any.s_addr = INADDR_ANY;
1446 return InitError(
_(
"Failed to listen on any port. Use -listen=0 if you want this."));
1449 if (
mapArgs.count(
"-externalip")) {
1450 BOOST_FOREACH(
const std::string& strAddr,
mapMultiArgs[
"-externalip"]) {
1459 BOOST_FOREACH(
const std::string& strDest,
mapMultiArgs[
"-seednode"])
1460 connman.AddOneShot(strDest);
1465 if (pzmqNotificationInterface) {
1473 if (
mapArgs.count(
"-maxuploadtarget")) {
1480 bool fReindexChainState =
GetBoolArg(
"-reindex-chainstate",
false);
1483 boost::filesystem::path blocksDir =
GetDataDir() /
"blocks";
1484 if (!boost::filesystem::exists(blocksDir))
1486 boost::filesystem::create_directories(blocksDir);
1487 bool linked =
false;
1488 for (
unsigned int i = 1; i < 10000; i++) {
1490 if (!boost::filesystem::exists(
source))
break;
1491 boost::filesystem::path dest = blocksDir /
strprintf(
"blk%05u.dat", i-1);
1493 boost::filesystem::create_hard_link(
source, dest);
1496 }
catch (
const boost::filesystem::filesystem_error& e) {
1499 LogPrintf(
"Error hardlinking blk%04u.dat: %s\n", i, e.what());
1511 nTotalCache = std::max(nTotalCache,
nMinDbCache << 20);
1512 nTotalCache = std::min(nTotalCache,
nMaxDbCache << 20);
1513 int64_t nBlockTreeDBCache = nTotalCache / 8;
1515 nBlockTreeDBCache = (1 << 21);
1516 nTotalCache -= nBlockTreeDBCache;
1517 int64_t nCoinDBCache = std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23));
1518 nTotalCache -= nCoinDBCache;
1521 LogPrintf(
"* Using %.1fMiB for block index database\n", nBlockTreeDBCache * (1.0 / 1024 / 1024));
1522 LogPrintf(
"* Using %.1fMiB for chain state database\n", nCoinDBCache * (1.0 / 1024 / 1024));
1525 bool fLoaded =
false;
1528 std::string strLoadError;
1554 strLoadError =
_(
"Error loading block database");
1561 return InitError(
_(
"Incorrect or no genesis block found. Wrong datadir for network?"));
1565 strLoadError =
_(
"Error initializing block database");
1571 strLoadError =
_(
"You need to rebuild the database using -reindex-chainstate to change -txindex");
1578 strLoadError =
_(
"You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain");
1584 LogPrintf(
"Prune: pruned datadir may not have more than %d blocks; -checkblocks=%d may fail\n",
1592 strLoadError =
_(
"The block database contains a block which appears to be from the future. " 1593 "This may be due to your computer's date and time being set incorrectly. " 1594 "Only rebuild the block database if you are sure that your computer's date and time are correct");
1601 strLoadError =
_(
"Corrupted block database detected");
1604 }
catch (
const std::exception& e) {
1606 strLoadError =
_(
"Error opening block database");
1617 strLoadError +
".\n\n" +
_(
"Do you want to rebuild the block database now?"),
1618 strLoadError +
".\nPlease restart with -reindex or -reindex-chainstate to recover.",
1624 LogPrintf(
"Aborted block database rebuild. Exiting.\n");
1638 LogPrintf(
"Shutdown requested. Exiting.\n");
1646 if (!est_filein.
IsNull())
1651 #ifdef ENABLE_WALLET 1652 if (fDisableWallet) {
1658 std::vector<CWalletTx> vWtx;
1677 bool fFirstRun =
true;
1683 strErrors <<
_(
"Error loading wallet.dat: Wallet corrupted") <<
"\n";
1686 InitWarning(
_(
"Error reading wallet.dat! All keys read correctly, but transaction data" 1687 " or address book entries might be missing or incorrect."));
1690 strErrors <<
_(
"Error loading wallet.dat: Wallet requires newer version of Dash Core") <<
"\n";
1693 strErrors <<
_(
"Wallet needed to be rewritten: restart Dash Core to complete") <<
"\n";
1698 strErrors <<
_(
"Error loading wallet.dat") <<
"\n";
1703 int nMaxVersion =
GetArg(
"-upgradewallet", 0);
1704 if (nMaxVersion == 0)
1711 LogPrintf(
"Allowing wallet upgrade up to %i\n", nMaxVersion);
1712 if (nMaxVersion < pwalletMain->GetVersion())
1713 strErrors <<
_(
"Cannot downgrade wallet") <<
"\n";
1723 if (
GetArg(
"-mnemonicpassphrase",
"").size() > 256)
1724 return InitError(
_(
"Mnemonic passphrase is too long, must be at most 256 characters"));
1736 strErrors <<
_(
"Cannot write default address") <<
"\n";
1742 std::string strBackupWarning;
1743 std::string strBackupError;
1745 if (!strBackupWarning.empty())
1747 if (!strBackupError.empty())
1752 else if (
mapArgs.count(
"-usehd")) {
1755 return InitError(
strprintf(
_(
"Error loading %s: You can't disable HD on a already existing HD wallet"), strWalletFile));
1757 return InitError(
strprintf(
_(
"Error loading %s: You can't enable HD on a already existing non-HD wallet"), strWalletFile));
1762 InitWarning(
_(
"Make sure to encrypt your wallet and delete all non-encrypted backups after you verified that wallet works!"));
1791 block = block->
pprev;
1793 if (pindexRescan != block)
1794 return InitError(
_(
"Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)"));
1806 if (
GetBoolArg(
"-zapwallettxes",
false) &&
GetArg(
"-zapwallettxes",
"1") !=
"2")
1810 BOOST_FOREACH(
const CWalletTx& wtxOld, vWtx)
1832 #else // ENABLE_WALLET 1833 LogPrintf(
"No wallet support compiled in!\n");
1834 #endif // !ENABLE_WALLET 1841 LogPrintf(
"Unsetting NODE_NETWORK on prune mode\n");
1851 if (
mapArgs.count(
"-blocknotify"))
1854 std::vector<boost::filesystem::path> vImportFiles;
1855 if (
mapArgs.count(
"-loadblock"))
1857 BOOST_FOREACH(
const std::string& strFile,
mapMultiArgs[
"-loadblock"])
1858 vImportFiles.push_back(strFile);
1860 threadGroup.create_thread(boost::bind(&
ThreadImport, vImportFiles));
1862 LogPrintf(
"Waiting for genesis block to be imported...\n");
1871 return InitError(
"Enabling Masternode support requires turning on transaction indexing." 1872 "Please add txindex=1 to your configuration and start with -reindex");
1878 if(!
GetArg(
"-masternodeaddr",
"").empty()) {
1881 return InitError(
_(
"masternodeaddr option is deprecated. Please use masternode.conf to manage your remote masternodes."));
1884 std::string strMasterNodePrivKey =
GetArg(
"-masternodeprivkey",
"");
1885 if(!strMasterNodePrivKey.empty()) {
1887 return InitError(
_(
"Invalid masternodeprivkey. Please see documenation."));
1891 return InitError(
_(
"You must specify a masternodeprivkey in the configuration. Please see documentation for help."));
1904 outputIndex = boost::lexical_cast<
unsigned int>(mne.
getOutputIndex());
1935 return InitError(
"You can not start a masternode in litemode");
1949 boost::filesystem::path pathDB =
GetDataDir();
1950 std::string strDBName;
1952 strDBName =
"mncache.dat";
1956 return InitError(
_(
"Failed to load masternode cache from") +
"\n" + (pathDB / strDBName).
string());
1960 strDBName =
"mnpayments.dat";
1964 return InitError(
_(
"Failed to load masternode payments cache from") +
"\n" + (pathDB / strDBName).
string());
1967 strDBName =
"governance.dat";
1971 return InitError(
_(
"Failed to load governance cache from") +
"\n" + (pathDB / strDBName).
string());
1978 strDBName =
"netfulfilled.dat";
1982 return InitError(
_(
"Failed to load fulfilled requests cache from") +
"\n" + (pathDB / strDBName).
string());
2005 if (!strErrors.str().empty())
2013 #ifdef ENABLE_WALLET 2033 std::string strNodeError;
2045 if (!connman.Start(scheduler, strNodeError, connOptions))
2056 #ifdef ENABLE_WALLET 2066 threadGroup.create_thread(boost::bind(&
ThreadSendAlert, boost::ref(connman)));
void CleanupBlockRevFiles()
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
unsigned int nWalletDBUpdated
bool ActivateBestChain(CValidationState &state, const CChainParams &chainparams, const CBlock *pblock)
static const int MAX_OUTBOUND_CONNECTIONS
static const unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT
std::string HelpMessageOpt(const std::string &option, const std::string &message)
static const int DEFAULT_SCRIPTCHECK_THREADS
void AppendParamsHelpMessages(std::string &strUsage, bool debugHelp)
static const bool DEFAULT_SPEND_ZEROCONF_CHANGE
Default for -spendzeroconfchange.
uint256 defaultAssumeValid
CNodeSignals & GetNodeSignals()
static const unsigned int DEFAULT_DESCENDANT_LIMIT
static const unsigned int DEFAULT_TX_CONFIRM_TARGET
-txconfirmtarget default
void OnRPCPreCommand(const CRPCCommand &cmd)
bool AppInit2(boost::thread_group &threadGroup, CScheduler &scheduler)
void SetBestChain(const CBlockLocator &loc)
void ThreadSendAlert(CConnman &connman)
std::vector< CMasternodeEntry > & getEntries()
boost::signals2::signal< void(const std::string &message)> InitMessage
static const bool DEFAULT_PERMIT_BAREMULTISIG
std::string NetworkIDString() const
void RegisterNodeSignals(CNodeSignals &nodeSignals)
void InitLogging()
Initialize the logging infrastructure.
void setSanityCheck(double dFrequency=1.0)
bool AddLocal(const CService &addr, int nScore)
void SetBroadcastTransactions(bool broadcast)
CMasternodeConfig masternodeConfig
void MilliSleep(int64_t n)
CActiveMasternode activeMasternode
static const int DEFAULT_HTTP_SERVER_TIMEOUT
bool SetAddressBook(const CTxDestination &address, const std::string &strName, const std::string &purpose)
#define TRY_LOCK(cs, name)
const char *const BITCOIN_CONF_FILENAME
static const unsigned int MAX_OP_RETURN_RELAY
bool GetCoins(const uint256 &txid, CCoins &coins) const
Retrieve the CCoins (unspent transaction outputs) for a given txid.
static const unsigned int DEFAULT_KEEPASS_HTTP_PORT
void SetRPCWarmupStatus(const std::string &newStatus)
static const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
static const CAmount nHighTransactionFeeWarning
-paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB ...
static const bool DEFAULT_FORCEDNSSEED
static const unsigned int DEFAULT_MAX_MEMPOOL_SIZE
const char *const BITCOIN_PID_FILENAME
void GenerateNewHDChain()
void OnPreCommand(boost::function< void(const CRPCCommand &)> slot)
static const int DEFAULT_HTTP_WORKQUEUE
CCriticalSection cs_wallet
bool SoftSetBoolArg(const std::string &strArg, bool fValue)
bool ReadFeeEstimates(CAutoFile &filein)
bool bSpendZeroConfChange
void RandAddSeedPerfmon()
static const int DEFAULT_INSTANTSEND_DEPTH
const Consensus::Params & GetConsensus() const
const std::string & getOutputIndex() const
CService LookupNumeric(const char *pszName, int portDefault)
static const bool DEFAULT_ACCEPT_DATACARRIER
static const int DEFAULT_GENERATE_THREADS
std::string DateTimeStrFormat(const char *pszFormat, int64_t nTime)
static const unsigned int MIN_BLOCKS_TO_KEEP
static const unsigned int DEFAULT_ANCESTOR_LIMIT
boost::filesystem::path GetPidFile()
const std::string CURRENCY_UNIT
static const int DEFAULT_PRIVATESEND_AMOUNT
static const bool DEFAULT_WALLETBROADCAST
void SetMockTime(int64_t nMockTimeIn)
bool fAcceptDatacarrier
bytes (+1 for OP_RETURN, +2 for the pushdata opcodes)
void SetLimited(enum Network net, bool fLimited)
static const bool DEFAULT_LISTEN
static const std::string TESTNET
const CBaseChainParams & BaseParams()
static const unsigned int DEFAULT_LIMITFREERELAY
const std::string & getTxHash() const
void UnregisterAllValidationInterfaces()
boost::signals2::signal< void(bool, const CBlockIndex *)> NotifyBlockTip
bool IsHex(const string &str)
unsigned short GetListenPort()
static const int64_t nMinDbCache
min. -dbcache in (MiB)
void UnregisterValidationInterface(CValidationInterface *pwalletIn)
void Flush(bool shutdown=false)
Flush wallet (bitdb flush)
bool BindListenPort(const CService &bindAddr, std::string &strError, bool fWhitelisted=false)
static const int DEFAULT_PRIVATESEND_LIQUIDITY
void AddTransactionsUpdated(unsigned int n)
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
CClientUIInterface * uiInterface
std::string LicenseInfo()
void InterruptHTTPServer()
bool SetNameProxy(const proxyType &addrProxy)
static const bool DEFAULT_LOGTIMEMICROS
static const unsigned int DEFAULT_KEYPOOL_SIZE
void RenameThread(const char *name)
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
boost::signals2::signal< bool(const std::string &message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeMessageBox
volatile bool fReopenDebugLog
static const bool DEFAULT_STOPAFTERBLOCKIMPORT
std::map< uint256, CWalletTx > mapWallet
static const bool DEFAULT_ADDRESSINDEX
bool ReadBestBlock(CBlockLocator &locator)
const std::string strWalletFile
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS
std::string HelpMessage(HelpMessageMode mode)
static const bool DEFAULT_LOGTIMESTAMPS
unsigned int nTimeReceived
unsigned int nReceiveFloodSize
unsigned short GetPort() const
int RaiseFileDescriptorLimit(int nMinFD)
static CCoinsViewErrorCatcher * pcoinscatcher
boost::signals2::signal< bool(const std::string &message, const std::string &noninteractive_message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeQuestion
bool SetMinVersion(enum WalletFeature, CWalletDB *pwalletdbIn=NULL, bool fExplicit=false)
signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVe...
void InitializeCurrentBlockTip()
void InitParameterInteraction()
Parameter interaction: change current parameters depending on various rules.
static const bool DEFAULT_DISABLE_SAFEMODE
void SetRPCWarmupFinished()
bool CheckDiskSpace(uint64_t nAdditionalBytes)
static const size_t DEFAULT_MAXRECEIVEBUFFER
CCoinsViewCache * pcoinsTip
DBErrors ZapWalletTx(std::vector< CWalletTx > &vWtx)
static bool GetKeysFromSecret(const std::string strSecret, CKey &keyRet, CPubKey &pubkeyRet)
Set the private/public key values, returns true if successful.
static const bool DEFAULT_LOGIPS
static bool InitWarning(const std::string &str)
unsigned int nTxConfirmTarget
bool fSendFreeTransactions
static const int DEFAULT_PRIVATESEND_ROUNDS
enum Network ParseNetwork(std::string net)
static const bool DEFAULT_ALERTS
size_t KeypoolCountInternalKeys()
bool GetKeyFromPool(CPubKey &key, bool fInternal)
static CZMQNotificationInterface * CreateWithArguments(const std::map< std::string, std::string > &args)
bool GetBoolArg(const std::string &strArg, bool fDefault)
bool SoftSetArg(const std::string &strArg, const std::string &strValue)
FILE * OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly)
static const bool DEFAULT_WHITELISTRELAY
const std::string DEFAULT_TOR_CONTROL
static boost::scoped_ptr< ECCVerifyHandle > globalVerifyHandle
CMasternodePayments mnpayments
volatile bool fRequestShutdown
static int LogPrint(const char *category, const char *format)
void Interrupt(boost::thread_group &threadGroup)
void UnregisterNodeSignals(CNodeSignals &nodeSignals)
std::string ToString() const
static const unsigned int DEFAULT_BYTES_PER_SIGOP
bool SetMaxVersion(int nVersion)
change which version we're allowed to upgrade to (note that this does not immediately imply upgrading...
uint256 uint256S(const char *str)
CAmount GetFeePerK() const
CClientUIInterface uiInterface
void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams &chainparams, CConnman &connman)
static CFeeRate fallbackFee
static const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT
static const unsigned int DEFAULT_MEMPOOL_EXPIRY
unsigned int nTimeSmart
time received by this node
CBlockIndex * Genesis() const
static const CAmount DEFAULT_TRANSACTION_MAXFEE
-maxtxfee default
bool IsLocked(bool fForMixing=false) const
std::string FormatParagraph(const std::string &in, size_t width, size_t indent)
static const int64_t nDefaultDbCache
-dbcache default (MiB)
static const bool DEFAULT_USE_HD_WALLET
if set, all keys will be derived by using BIP39/BIP44
std::vector< std::pair< std::string, std::string > > vOrderForm
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS
bool ParseMoney(const string &str, CAmount &nRet)
static const unsigned int DEFAULT_BLOCK_MAX_SIZE
static const CAmount DEFAULT_LEGACY_TRANSACTION_MINFEE
-mintxfee default
static const bool DEFAULT_SEND_FREE_TRANSACTIONS
Default for -sendfreetransactions.
static const CAmount DEFAULT_LEGACY_FALLBACK_FEE
-fallbackfee default
static const unsigned int DEFAULT_WALLET_DBLOGSIZE
const std::string CLIENT_NAME
std::string strSubVersion
static const int DEFAULT_NAME_LOOKUP
-dns default
static const bool DEFAULT_LOGTHREADNAMES
int size()
Return the number of (unique) Masternodes.
std::string FormatMoney(const CAmount &n)
static bool InitError(const std::string &str)
static const bool DEFAULT_PROXYRANDOMIZE
ServiceFlags nLocalServices
std::string FormatFullVersion()
DBErrors LoadWallet(bool &fFirstRunRet)
void ThreadImport(std::vector< boost::filesystem::path > vImportFiles)
const std::string CLIENT_DATE
static const unsigned int DEFAULT_BLOCK_MIN_SIZE
bool LookupSubNet(const char *pszName, CSubNet &ret)
bool SetProxy(enum Network net, const proxyType &addrProxy)
static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE
void RegisterValidationInterface(CValidationInterface *pwalletIn)
static bool FlushStateToDisk(CValidationState &state, FlushStateMode mode)
CSporkManager sporkManager
static const CAmount nHighTransactionMaxFeeWarning
-maxtxfee will warn if called with a higher fee than this amount (in satoshis)
std::string strFromAccount
size_t KeypoolCountExternalKeys()
void seed_insecure_rand(bool fDeterministic)
CPrivateSendClient privateSendClient
bool glibcxx_sanity_test()
bool LoadExternalBlockFile(const CChainParams &chainparams, FILE *fileIn, CDiskBlockPos *dbp)
static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex)
void ThreadFlushWalletDB(const string &strFile)
bool fFeeEstimatesInitialized
int ScanForWalletTransactions(CBlockIndex *pindexStart, bool fUpdate=false)
static const bool DEFAULT_CHECKPOINTS_ENABLED
static const bool DEFAULT_GENERATE
static const bool DEFAULT_ENABLE_REPLACEMENT
static const bool DEFAULT_TESTSAFEMODE
isminetype IsMine(const CTxIn &txin) const
static const size_t DEFAULT_MAXSENDBUFFER
std::string GetWarnings(const std::string &strFor)
static const uint64_t DEFAULT_MAX_UPLOAD_TARGET
static bool Verify(const std::string &walletFile, std::string &warningString, std::string &errorString)
Verify the wallet database and perform salvage if required.
const CChainParams & Params()
void SetMinBlocksToWait(int nMinBlocksToWaitIn)
CKeePassIntegrator keePassInt
static const char * FEE_ESTIMATES_FILENAME
static const signed int DEFAULT_CHECKBLOCKS
const uint256 & GetHash() const
static const unsigned int DEFAULT_MISBEHAVING_BANTIME
unsigned int nStatus
Verification status of this block. See enum BlockStatus.
CBlockIndex * FindForkInGlobalIndex(const CChain &chain, const CBlockLocator &locator)
int64_t GetAdjustedTime()
void runCommand(const std::string &strCommand)
static const bool DEFAULT_FLUSHWALLET
static const int DEFAULT_CONNECT_TIMEOUT
-timeout default
bool Lookup(const char *pszName, std::vector< CService > &vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions)
uint256 GetBlockHash() const
void StartTorControl(boost::thread_group &threadGroup, CScheduler &scheduler)
static const int64_t nMaxDbCache
max. -dbcache in (MiB)
static const bool DEFAULT_TIMESTAMPINDEX
std::string FormatSubVersion(const std::string &name, int nClientVersion, const std::vector< std::string > &comments)
bool AppInitServers(boost::thread_group &threadGroup)
void ReacceptWalletTransactions()
CNetFulfilledRequestManager netfulfilledman
std::string GetHex() const
unsigned int nSendBufferMaxSize
std::exception thrown in command handling
bool WriteFeeEstimates(CAutoFile &fileout) const
std::unique_ptr< CConnman > g_connman
void Discover(boost::thread_group &threadGroup)
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE)
static const unsigned int MAX_SUBVERSION_LENGTH
bool InitSanityCheck(void)
std::map< CTxDestination, CAddressBookData > mapAddressBook
static CDSNotificationInterface * pdsNotificationInterface
static const bool DEFAULT_UPNP
CBlockIndex * Tip() const
std::unique_ptr< PeerLogicValidation > peerLogic
boost::function< void(void)> Function
CBlockTreeDB * pblocktree
static const bool DEFAULT_BLOCKSONLY
bool SetPrivKey(std::string strPrivKey)
boost::filesystem::path GetMasternodeConfigFile()
static const std::string MAIN
static const bool DEFAULT_WALLET_PRIVDB
ServiceFlags nRelevantServices
static const unsigned int DEFAULT_BANSCORE_THRESHOLD
bool WriteToDisk(CWalletDB *pwalletdb)
std::string GetArg(const std::string &strArg, const std::string &strDefault)
void InterruptTorControl()
static const bool DEFAULT_SPENTINDEX
CBlockIndex * pprev
pointer to the index of the predecessor of this block
void ThreadCheckPrivateSendClient(CConnman &connman)
int64_t GetTime()
For unit testing.
unsigned int nBytesPerSigOp
CGovernanceManager governance
static void InitStandardDenominations()
bool ECC_InitSanityCheck()
void LockCoin(COutPoint &output)
static const bool DEFAULT_PRINTPRIORITY
void OnStopped(boost::function< void()> slot)
static const unsigned int DEFAULT_LEGACY_MIN_RELAY_TX_FEE
CBlockLocator GetLocator(const CBlockIndex *pindex=NULL) const
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES
#define MIN_CORE_FILEDESCRIPTORS
map< string, vector< string > > mapMultiArgs
void SetHex(const char *psz)
static const bool DEFAULT_RELAYPRIORITY
void ThreadCheckPrivateSend(CConnman &connman)
int nHeight
height of the entry in the chain. The genesis block has height 0
static const bool DEFAULT_WHITELISTFORCERELAY
static const int CLIENT_VERSION
static const bool DEFAULT_LISTEN_ONION
bool WriteReindexing(bool fReindex)
UniValue JSONRPCError(int code, const string &message)
std::string HelpMessageGroup(const std::string &message)
static const bool DEFAULT_PRIVATESEND_MULTISESSION
static const bool DEFAULT_TXINDEX
static const int DEFAULT_HTTP_THREADS
static const bool DEFAULT_REST_ENABLE
void ThreadCheckPrivateSendServer(CConnman &connman)
bool AutoBackupWallet(CWallet *wallet, std::string strWalletFile, std::string &strBackupWarning, std::string &strBackupError)
unsigned nMaxDatacarrierBytes
string SanitizeString(const string &str, int rule)
bool GetCoins(const uint256 &txid, CCoins &coins) const
Retrieve the CCoins (unspent transaction outputs) for a given txid.
static const unsigned int DEFAULT_CHECKLEVEL
CCoinsViewErrorCatcher(CCoinsView *view)
bool IsLimited(enum Network net)
bool SetDefaultKey(const CPubKey &vchPubKey)
std::string _(const char *psz)
int atoi(const std::string &str)
static const int MAX_SCRIPTCHECK_THREADS
map< string, string > mapArgs
static bool Bind(CConnman &connman, const CService &addr, unsigned int flags)
CConditionVariable cvBlockChange
bool fPrivateSendMultiSession
boost::filesystem::path GetDefaultDataDir()
static CCoinsViewDB * pcoinsdbview
bool InitBlockIndex(const CChainParams &chainparams)
boost::filesystem::path GetBlockPosFilename(const CDiskBlockPos &pos, const char *prefix)
boost::filesystem::path GetConfigFile()
bool DefaultConsistencyChecks() const