44 std::vector<CStakeableOutput> availableCoins;
49 std::unique_ptr<CBlockTemplate> pblocktemplate(fPoS ?
51 CreateNewBlockWithScript(*coinbaseScript, pwallet));
52 if (!pblocktemplate.get())
break;
53 std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>(pblocktemplate->block);
57 if (!
SolveBlock(pblock, nHeight + 1))
continue;
60 sc.get().setBlockHash(pblock->GetHash());
62 if (!res || sc.get().stateErrorFound())
66 blockHashes.
push_back(pblock->GetHash().GetHex());
73 const int nGenerated = blockHashes.
size();
74 if (nGenerated == 0 || (!fPoS && nGenerated < nGenerate))
88 throw std::runtime_error(
90 "\nMine blocks immediately (before the RPC call returns)\n"
91 "\nNote: this function can only be used on the regtest network\n"
94 "1. nblocks (numeric, required) How many blocks to generate.\n"
97 "[ blockhashes ] (array) hashes of blocks generated\n"
100 "\nGenerate 11 blocks\n"
104 if (!
Params().IsRegTestNet())
114 nHeightEnd = nHeight + nGenerate;
119 std::unique_ptr<CReserveKey> reservekey;
127 reservekey = std::make_unique<CReserveKey>(pwallet);
134 UniValue blockHashes = generateBlocks(consensus,
145 reservekey->KeepKey();
159 throw std::runtime_error(
160 "generatetoaddress nblocks \"address\"\n"
161 "\nMine blocks immediately to a specified address (before the RPC call returns)\n"
163 "1. nblocks (numeric, required) How many blocks are generated immediately.\n"
164 "2. \"address\" (string, required) The address to send the newly generated bitcoin to.\n"
166 "[ blockhashes ] (array) hashes of blocks generated\n"
168 "\nGenerate 11 blocks to myaddress\n"
186 nHeightEnd = nHeight + nGenerate;
190 return generateBlocks(consensus,
201 #ifdef ENABLE_MINING_RPC
207 UniValue GetNetworkHashPS(
int lookup,
int height)
214 if (pb ==
nullptr || !pb->
nHeight)
219 lookup = pb->
nHeight % 2016 + 1;
227 int64_t maxTime = minTime;
228 for (
int i = 0; i < lookup; i++) {
231 minTime = std::min(time, minTime);
232 maxTime = std::max(time, maxTime);
236 if (minTime == maxTime)
240 int64_t timeDiff = maxTime - minTime;
242 return (int64_t)(workDiff.
getdouble() / timeDiff);
248 throw std::runtime_error(
249 "getnetworkhashps ( nblocks height )\n"
250 "\nReturns the estimated network hashes per second based on the last n blocks.\n"
251 "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
252 "Pass in [height] to estimate the network speed at the time when a certain block was found.\n"
255 "1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n"
256 "2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n"
259 "x (numeric) Hashes per second estimated\n"
271 throw std::runtime_error(
273 "\nReturn if the server is set to generate coins or not. The default is false.\n"
274 "It is set with the command line argument -gen (or pivx.conf setting gen)\n"
275 "It can also be set with the setgenerate call.\n"
278 "true|false (boolean) If the server is set to generate coins or not\n"
295 throw std::runtime_error(
296 "setgenerate generate ( genproclimit )\n"
297 "\nSet 'generate' true or false to turn generation on or off.\n"
298 "Generation is limited to 'genproclimit' processors, -1 is unlimited.\n"
299 "See the getgenerate call for the current setting.\n"
302 "1. generate (boolean, required) Set to true to turn on generation, false to turn off.\n"
303 "2. genproclimit (numeric, optional) Set the processor limit for when generation is on. Can be -1 for unlimited.\n"
306 "\nSet the generation on with a limit of one processor\n" +
309 "\nTurn off generation\n" +
HelpExampleCli(
"setgenerate",
"false") +
312 if (
Params().IsRegTestNet())
315 bool fGenerate =
true;
323 int nGenProcLimit = -1;
326 if (nGenProcLimit == 0)
330 gArgs.
GetArg(
"-gen",
"") = (fGenerate ?
"1" :
"0");
332 GenerateBitcoins(fGenerate, pwallet, nGenProcLimit);
340 throw std::runtime_error(
342 "\nReturns a recent hashes per second performance measurement while generating.\n"
343 "See the getgenerate and setgenerate calls to turn generation on and off.\n"
346 "n (numeric) The recent hashes per second when generation is on (will return 0 if generation is off)\n"
361 throw std::runtime_error(
363 "\nReturns a json object containing mining-related information."
367 " \"blocks\": nnn, (numeric) The current block\n"
368 " \"currentblocksize\": nnn, (numeric) The last block size\n"
369 " \"currentblocktx\": nnn, (numeric) The last block transaction\n"
370 " \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n"
371 " \"generate\": true|false (boolean) If the generation is on or off (see getgenerate or setgenerate calls)\n"
372 " \"genproclimit\": n (numeric) The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)\n"
373 " \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\n"
374 " \"pooledtx\": n (numeric) The size of the mem pool\n"
375 " \"testnet\": true|false (boolean) If using testnet or not\n"
376 " \"chain\": \"xxxx\", (string) current network name (main, test, regtest)\n"
377 " \"warnings\": \"...\" (string) any network and blockchain warnings\n"
378 " \"errors\": \"...\" (string) DEPRECATED. Same as warnings. Only shown when bitcoind is started with -deprecatedrpc=getmininginfo\n"
391 obj.pushKV(
"genproclimit", (
int)
gArgs.
GetArg(
"-genproclimit", -1));
392 obj.pushKV(
"networkhashps", getnetworkhashps(request));
394 obj.pushKV(
"testnet",
Params().IsTestnet());
395 obj.pushKV(
"chain",
Params().NetworkIDString());
403 obj.pushKV(
"generate", getgenerate(request));
404 obj.pushKV(
"hashespersec", gethashespersec(request));
414 throw std::runtime_error(
415 "prioritisetransaction \"txid\" priority_delta fee_delta\n"
416 "Accepts the transaction into mined blocks at a higher (or lower) priority\n"
419 "1. \"txid\" (string, required) The transaction id.\n"
420 "2. fee_delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\n"
421 " The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
422 " considers the transaction as it would have paid a higher (or lower) fee.\n"
425 "true (boolean) Returns true\n"
449 if (strRejectReason.empty())
451 return strRejectReason;
457 #ifdef ENABLE_MINING_RPC
463 throw std::runtime_error(
464 "getblocktemplate ( \"template_request\" )\n"
465 "\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
466 "It returns data needed to construct a block to work on.\n"
467 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
470 "1. template_request (json object, optional) A json object in the following spec\n"
472 " \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted\n"
473 " \"capabilities\":[ (array, optional) A list of strings\n"
474 " \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n"
482 " \"version\" : n, (numeric) The block version\n"
483 " \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
484 " \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n"
486 " \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
487 " \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n"
488 " \"depends\" : [ (array) array of numbers \n"
489 " n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n"
492 " \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in upiv); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
493 " \"sigops\" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any\n"
494 " \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
498 " \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
499 " \"flags\" : \"flags\" (string) \n"
501 " \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in upiv)\n"
502 " \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
503 " \"target\" : \"xxxx\", (string) The hash target\n"
504 " \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n"
505 " \"mutable\" : [ (array of string) list of ways the block template may be changed \n"
506 " \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n"
509 " \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n"
510 " \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n"
511 " \"sizelimit\" : n, (numeric) limit of block size\n"
512 " \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
513 " \"bits\" : \"xxx\", (string) compressed target of next block\n"
514 " \"height\" : n (numeric) The height of the next block\n"
515 " \"payee\" : \"xxx\", (string) required payee for the next block\n"
516 " \"payee_amount\" : n, (numeric) required amount to pay\n"
517 " \"votes\" : [\n (array) show vote candidates\n"
518 " { ... } (json object) vote candidate\n"
521 " \"enforce_masternode_payments\" : true|false (boolean) true, if masternode payments are enforced\n"
529 std::string strMode =
"template";
536 else if (modeval.
isNull()) {
542 if (strMode ==
"proposal") {
544 if (!dataval.
isStr())
557 return "duplicate-invalid";
558 return "duplicate-inconclusive";
564 return "inconclusive-not-best-prevblk";
567 return BIP22ValidationResult(state);
571 if (strMode !=
"template")
583 static unsigned int nTransactionsUpdatedLast;
589 unsigned int nTransactionsUpdatedLastLP;
593 std::string lpstr = lpval.
get_str();
595 hashWatchedChain =
ParseHashV(lpstr.substr(0, 64),
"longpollid");
596 nTransactionsUpdatedLastLP =
atoi64(lpstr.substr(64));
600 nTransactionsUpdatedLastLP = nTransactionsUpdatedLast;
606 checktxtime = std::chrono::steady_clock::now() + std::chrono::minutes(1);
610 if (
g_best_block_cv.wait_until(lock, checktxtime) == std::cv_status::timeout)
615 checktxtime += std::chrono::seconds(10);
628 static int64_t nStart;
629 static std::unique_ptr<CBlockTemplate> pblocktemplate;
633 pindexPrev =
nullptr;
641 if (pblocktemplate) {
642 pblocktemplate.release();
643 pblocktemplate =
nullptr;
651 pindexPrev = pindexPrevNew;
653 CBlock* pblock = &pblocktemplate->block;
662 std::map<uint256, int64_t> setTxIndex;
664 for (
const auto& txIn : pblock->
vtx) {
667 setTxIndex[txHash] = i++;
676 entry.pushKV(
"hash", txHash.
GetHex());
683 entry.pushKV(
"depends", deps);
685 int index_in_template = i - 1;
686 entry.pushKV(
"fee", pblocktemplate->vTxFees[index_in_template]);
687 entry.pushKV(
"sigops", pblocktemplate->vTxSigOps[index_in_template]);
689 transactions.push_back(entry);
698 if (aMutable.empty()) {
699 aMutable.push_back(
"time");
700 aMutable.push_back(
"transactions");
701 aMutable.push_back(
"prevblock");
707 result.pushKV(
"capabilities", aCaps);
708 result.pushKV(
"version", pblock->
nVersion);
710 result.pushKV(
"transactions", transactions);
711 result.pushKV(
"coinbaseaux", aux);
712 result.pushKV(
"coinbasevalue", (int64_t)pblock->
vtx[0]->GetValueOut());
714 result.pushKV(
"target", hashTarget.
GetHex());
716 result.pushKV(
"mutable", aMutable);
717 result.pushKV(
"noncerange",
"00000000ffffffff");
722 result.pushKV(
"height", (int64_t)(pindexPrev->
nHeight + 1));
723 result.pushKV(
"votes", aVotes);
724 result.pushKV(
"enforce_masternode_payments",
true);
733 throw std::runtime_error(
734 "submitblock \"hexdata\" ( \"jsonparametersobject\" )\n"
735 "\nAttempts to submit new block to network.\n"
736 "The 'jsonparametersobject' parameter is currently ignored.\n"
737 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
740 "1. \"hexdata\" (string, required) the hex-encoded block data to submit\n"
741 "2. \"parameters\" (string, optional) object of optional parameters\n"
743 " \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions\n"
751 std::shared_ptr<CBlock> blockptr = std::make_shared<CBlock>();
752 CBlock& block = *blockptr;
756 if (block.
vtx.empty() || !block.
vtx[0]->IsCoinBase()) {
761 bool fBlockPresent =
false;
769 return "duplicate-invalid";
771 fBlockPresent =
true;
780 return "duplicate-inconclusive";
785 return "inconclusive";
787 return BIP22ValidationResult(sc.
get().
state);
793 throw std::runtime_error(
794 "estimatefee nblocks\n"
795 "\nEstimates the approximate fee per kilobyte\n"
796 "needed for a transaction to begin confirmation\n"
797 "within nblocks blocks.\n"
800 "1. nblocks (numeric)\n"
803 "n : (numeric) estimated fee-per-kilobyte\n"
805 "-1.0 is returned if not enough transactions and\n"
806 "blocks have been observed to make an estimate.\n"
827 throw std::runtime_error(
828 "estimatesmartfee nblocks\n"
829 "\nDEPRECATED. WARNING: This interface is unstable and may disappear or change!\n"
830 "\nEstimates the approximate fee per kilobyte needed for a transaction to begin\n"
831 "confirmation within nblocks blocks if possible and return the number of blocks\n"
832 "for which the estimate is valid.\n"
834 "1. nblocks (numeric)\n"
837 " \"feerate\" : x.x, (numeric) estimate fee-per-kilobyte (in BTC)\n"
838 " \"blocks\" : n (numeric) block number where estimate was found\n"
841 "A negative value is returned if not enough transactions and blocks\n"
842 "have been observed to make an estimate for any number of blocks.\n"
843 "However it will not return a value below the mempool reject fee.\n"
856 result.
pushKV(
"blocks", answerFound);
864 {
"util",
"estimatefee", &
estimatefee,
true, {
"nblocks"} },
866 {
"mining",
"prioritisetransaction", &
prioritisetransaction,
true, {
"txid",
"priority_delta",
"fee_delta"} },
870 {
"hidden",
"generate", &generate,
true, {
"nblocks"} },
871 {
"hidden",
"generatetoaddress", &generatetoaddress,
true, {
"nblocks",
"address"} },
873 {
"hidden",
"submitblock", &
submitblock,
true, {
"hexdata",
"parameters"} },
874 #ifdef ENABLE_MINING_RPC
875 {
"hidden",
"getblocktemplate", &getblocktemplate,
true, {
"template_request"} },
876 {
"hidden",
"getnetworkhashps", &getnetworkhashps,
true, {
"nblocks",
"height"} },
877 {
"hidden",
"getmininginfo", &getmininginfo,
true, {} },
879 {
"hidden",
"getgenerate", &getgenerate,
true, {} },
880 {
"hidden",
"gethashespersec", &gethashespersec,
true, {} },
881 {
"hidden",
"setgenerate", &setgenerate,
true, {
"generate",
"genproclimit"} },
890 for (
unsigned int vcidx = 0; vcidx <
ARRAYLEN(commands); vcidx++)
int64_t CAmount
Amount in PIV (Can be negative)
bool SolveBlock(std::shared_ptr< CBlock > &pblock, int nHeight)
Modify the nonce/extranonce in a block.
int64_t UpdateTime(CBlockHeader *pblock, const Consensus::Params &consensusParams, const CBlockIndex *pindexPrev)
double GetDifficulty(const CBlockIndex *blockindex)
@ BLOCK_VALID_SCRIPTS
Scripts & signatures ok. Implies all parents are also at least SCRIPTS.
@ BLOCK_FAILED_MASK
descends from failed block
const CChainParams & Params()
Return the currently selected parameters.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
std::unique_ptr< CBlockTemplate > CreateNewBlock(const CScript &scriptPubKeyIn, CWallet *pwallet=nullptr, bool fProofOfStake=false, std::vector< CStakeableOutput > *availableCoins=nullptr, bool fNoMempoolTx=false, bool fTestValidity=true, CBlockIndex *prevBlock=nullptr, bool stopPoSOnNewBlock=true, bool fIncludeQfc=true)
Construct a new block template with coinbase to scriptPubKeyIn.
BlockStateCatcher & get() const
std::vector< CTransactionRef > vtx
The block chain is a tree shaped structure starting with the genesis block at the root,...
CBlockIndex * pprev
pointer to the index of the predecessor of this block
arith_uint256 nChainWork
(memory only) Total amount of work (expected number of hashes) in the chain up to and including this ...
uint256 GetBlockHash() const
int64_t GetBlockTime() const
int64_t GetMedianTimePast() const
bool IsValid(enum BlockStatus nUpTo=BLOCK_VALID_TRANSACTIONS) const
Check whether this block index entry is valid up to the passed validity level.
int nHeight
height of the entry in the chain. The genesis block has height 0
uint32_t nStatus
Verification status of this block. See enum BlockStatus.
CBlockIndex * Tip(bool fProofOfStake=false) const
Returns the index entry for the tip of this chain, or nullptr if none.
int Height() const
Return the maximal height in the chain.
const Consensus::Params & GetConsensus() const
Fee rate in PIV per kilobyte: CAmount / kB.
CAmount GetFeePerK() const
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
PIVX RPC command dispatcher.
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
const uint256 & GetHash() const
An input of a transaction.
void PrioritiseTransaction(const uint256 &hash, const CAmount &nFeeDelta)
Affect CreateNewBlock prioritisation of transactions.
CFeeRate estimateFee(int nBlocks) const
Estimate fee rate needed to get into the next nBlocks.
CFeeRate estimateSmartFee(int nBlocks, int *answerFoundAtBlocks=nullptr) const
Estimate fee rate needed to get into the next nBlocks If no answer can be given at nBlocks,...
unsigned long size() const
unsigned int GetTransactionsUpdated() const
Capture information about block/transaction validation.
std::string GetRejectReason() const
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
const std::string & get_str() const
int64_t get_int64() const
const UniValue & get_obj() const
bool push_back(const UniValue &val)
bool pushKV(const std::string &key, const UniValue &val)
256-bit unsigned big integer.
arith_uint256 & SetCompact(uint32_t nCompact, bool *pfNegative=nullptr, bool *pfOverflow=nullptr)
The "compact" format is a representation of a whole number N using an unsigned 32bit number similar t...
std::string GetHex() const
std::string GetHex() const
std::string EncodeHexTx(const CTransaction &tx)
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
uint256 ParseHashStr(const std::string &, const std::string &strName)
bool StakeableCoins(std::vector< CStakeableOutput > *pCoins=nullptr)
Available coins (staking)
std::unique_ptr< CConnman > g_connman
void RegisterMiningRPCCommands(CRPCTable &tableRPC)
Register mining RPC commands.
UniValue estimatesmartfee(const JSONRPCRequest &request)
UniValue prioritisetransaction(const JSONRPCRequest &request)
UniValue estimatefee(const JSONRPCRequest &request)
UniValue submitblock(const JSONRPCRequest &request)
bool IsValidDestination(const CWDestination &address)
CWDestination DecodeDestination(const std::string &strAddress)
clock::time_point time_point
RecursiveMutex cs_main
Global state.
UniValue JSONRPCError(int code, const std::string &message)
@ RPC_OUT_OF_MEMORY
Invalid address or key.
@ RPC_WALLET_INSUFFICIENT_FUNDS
Unspecified problem with wallet (key not found etc.)
@ RPC_TYPE_ERROR
Server is in safe mode, and command is not allowed in safe mode.
@ RPC_CLIENT_NOT_CONNECTED
P2P client errors.
@ RPC_INVALID_PARAMETER
Ran out of memory during operation.
@ RPC_VERIFY_ERROR
Error parsing or validating structure in raw format.
@ RPC_CLIENT_IN_INITIAL_DOWNLOAD
PIVX is not connected.
@ RPC_DESERIALIZATION_ERROR
Database error.
@ RPC_INVALID_REQUEST
Standard JSON-RPC 2.0 errors.
@ RPC_INVALID_ADDRESS_OR_KEY
Unexpected type was passed as parameter.
@ RPC_CLIENT_P2P_DISABLED
Invalid IP/Subnet.
CWallet * GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
void EnsureWalletIsUnlocked(CWallet *const pwallet, bool fAllowAnonOnly)
bool EnsureWalletIsAvailable(CWallet *const pwallet, bool avoidException)
bool IsDeprecatedRPCEnabled(const std::string &method)
UniValue ValueFromAmount(const CAmount &amount)
bool IsRPCRunning()
Query whether RPC is running.
std::string HelpExampleCli(std::string methodname, std::string args)
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull)
Type-check arguments; throws JSONRPCError if wrong type given.
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded Values (throws error if not hex).
std::string HelpExampleRpc(std::string methodname, std::string args)
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a PIVX scriptPubKey for the given CTxDestination.
boost::variant< CNoDestination, CKeyID, CScriptID, CExchangeKeyID > CTxDestination
A txout script template with a specific destination.
Parameters that influence chain consensus.
bool NetworkUpgradeActive(int nHeight, Consensus::UpgradeIndex idx) const
Returns true if the given network upgrade is active as of the given block height.
#define WAIT_LOCK(cs, name)
#define ENTER_CRITICAL_SECTION(cs)
#define LEAVE_CRITICAL_SECTION(cs)
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
const uint256 UINT256_ZERO
constant uint256 instances
const UniValue & find_value(const UniValue &obj, const std::string &name)
const UniValue NullUniValue
bool NetworkUpgradeActive(int nHeight, const Consensus::Params ¶ms, Consensus::UpgradeIndex idx)
Returns true if the given network upgrade is active as of the given block height.
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
int64_t atoi64(const char *psz)
std::string itostr(int n)
std::string i64tostr(int64_t n)
int64_t GetTimeMillis()
Returns the system time (not mockable)
int64_t GetTime()
DEPRECATED Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)
std::condition_variable g_best_block_cv
CTxMemPool mempool(::minRelayTxFee)
CScript COINBASE_FLAGS
Constant stuff for coinbase transactions we create:
bool IsInitialBlockDownload()
Check whether we are doing an initial block download (synchronizing from disk or network)
bool ProcessNewBlock(const std::shared_ptr< const CBlock > &pblock, const FlatFilePos *dbp)
Process an incoming block.
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
bool TestBlockValidity(CValidationState &state, const CBlock &block, CBlockIndex *const pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckBlockSig)
Check a block is completely valid from start to finish (only works on top of our current best block,...
CBlockIndex * LookupBlockIndex(const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
std::string GetWarnings(const std::string &strFor)