9#include <chainparams.h>
63 if (lookup < -1 || lookup == 0) {
67 if (height < -1 || height > active_chain.
Height()) {
74 pb = active_chain[height];
77 if (pb ==
nullptr || !pb->
nHeight)
90 int64_t maxTime = minTime;
91 for (
int i = 0; i < lookup; i++) {
94 minTime = std::min(time, minTime);
95 maxTime = std::max(time, maxTime);
99 if (minTime == maxTime)
103 int64_t timeDiff = maxTime - minTime;
111 "\nReturns the estimated network hashes per second based on the last n blocks.\n"
112 "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
113 "Pass in [height] to estimate the network speed at the time when a certain block was found.\n",
115 {
"nblocks",
RPCArg::Type::NUM,
RPCArg::Default{120},
"The number of previous blocks to calculate estimate from, or -1 for blocks since last difficulty change."},
145 if (block.
nNonce == std::numeric_limits<uint32_t>::max()) {
149 block_out = std::make_shared<const CBlock>(block);
151 if (!process_new_block)
return true;
164 std::unique_ptr<CBlockTemplate> pblocktemplate(miner.
createNewBlock(coinbase_script));
165 if (!pblocktemplate.get())
168 std::shared_ptr<const CBlock> block_out;
169 if (!
GenerateBlock(chainman, miner, pblocktemplate->block, nMaxTries, block_out,
true)) {
175 blockHashes.
push_back(block_out->GetHash().GetHex());
184 const auto desc =
Parse(descriptor, key_provider, error,
false);
186 if (desc->IsRange()) {
191 std::vector<CScript> scripts;
192 if (!desc->Expand(0, key_provider, scripts, provider)) {
199 if (scripts.size() == 1) {
201 }
else if (scripts.size() == 4) {
218 "generatetodescriptor",
219 "Mine to a specified descriptor and return the block hashes.",
232 "\nGenerate 11 blocks to mydesc\n" +
HelpExampleCli(
"generatetodescriptor",
"11 \"mydesc\"")},
235 const auto num_blocks{self.
Arg<
int>(
"num_blocks")};
236 const auto max_tries{self.
Arg<uint64_t>(
"maxtries")};
248 return generateBlocks(chainman, miner, coinbase_script, num_blocks, max_tries);
263 "Mine to a specified address and return the block hashes.",
275 "\nGenerate 11 blocks to myaddress\n"
277 +
"If you are using the " PACKAGE_NAME " wallet, you can get a new address to send the newly generated bitcoin to with:\n"
282 const int num_blocks{request.params[0].getInt<
int>()};
283 const uint64_t max_tries{request.params[2].isNull() ?
DEFAULT_MAX_TRIES : request.params[2].getInt<
int>()};
296 return generateBlocks(chainman, miner, coinbase_script, num_blocks, max_tries);
304 "Mine a set of ordered transactions to a specified address or descriptor and return the block hash.",
308 "Txids must reference transactions currently in the mempool.\n"
309 "All transactions must be valid and in valid order, otherwise the block will be rejected.",
324 "\nGenerate a block to myaddress, with txs rawtx and mempool_txid\n"
325 +
HelpExampleCli(
"generateblock", R
"("myaddress" '["rawtx", "mempool_txid"]')")
329 const auto address_or_descriptor = request.params[0].get_str();
346 std::vector<CTransactionRef> txs;
347 const auto raw_txs_or_txids = request.params[1].get_array();
348 for (
size_t i = 0; i < raw_txs_or_txids.size(); i++) {
349 const auto& str{raw_txs_or_txids[i].get_str()};
353 const auto tx{mempool.
get(*hash)};
358 txs.emplace_back(tx);
368 const bool process_new_block{request.params[2].isNull() ? true : request.params[2].get_bool()};
373 std::unique_ptr<CBlockTemplate> blocktemplate{miner.
createNewBlock(coinbase_script, {.use_mempool =
false})};
374 if (!blocktemplate) {
377 block = blocktemplate->block;
383 block.
vtx.insert(block.
vtx.end(), txs.begin(), txs.end());
384 RegenerateCommitments(block, chainman);
393 std::shared_ptr<const CBlock> block_out;
396 if (!
GenerateBlock(chainman, miner, block, max_tries, block_out, process_new_block) || !block_out) {
401 obj.
pushKV(
"hash", block_out->GetHash().GetHex());
402 if (!process_new_block) {
415 "\nReturns a json object containing mining-related information.",
421 {
RPCResult::Type::NUM,
"currentblockweight",
true,
"The block weight of the last assembled block (only present if a block was ever assembled)"},
422 {
RPCResult::Type::NUM,
"currentblocktx",
true,
"The number of block transactions of the last assembled block (only present if a block was ever assembled)"},
429 RPCResult{
RPCResult::Type::ARR,
"warnings",
"any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)",
454 obj.
pushKV(
"pooledtx", (uint64_t)mempool.
size());
467 "Accepts the transaction into mined blocks at a higher (or lower) priority\n",
471 " DEPRECATED. For forward compatibility use named arguments and omit this parameter."},
473 " Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.\n"
474 " The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
475 " considers the transaction as it would have paid a higher (or lower) fee."},
488 const auto dummy{self.
MaybeArg<
double>(
"dummy")};
489 CAmount nAmount = request.params[2].getInt<int64_t>();
491 if (dummy && *dummy != 0) {
503 return RPCHelpMan{
"getprioritisedtransactions",
504 "Returns a map of all user-created (see prioritisetransaction) fee deltas by txid, and whether the tx is present in mempool.",
512 {
RPCResult::Type::NUM,
"modified_fee",
true,
"modified fee in satoshis. Only returned if in_mempool=true"},
527 result_inner.
pushKV(
"fee_delta", delta_info.delta);
528 result_inner.pushKV(
"in_mempool", delta_info.in_mempool);
529 if (delta_info.in_mempool) {
530 result_inner.pushKV(
"modified_fee", *delta_info.modified_fee);
532 rpc_result.pushKV(delta_info.txid.GetHex(), std::move(result_inner));
551 if (strRejectReason.empty())
553 return strRejectReason;
561 std::string s = vbinfo.
name;
563 s.insert(s.begin(),
'!');
571 "\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
572 "It returns data needed to construct a block to work on.\n"
573 "For full specification, see BIPs 22, 23, 9, and 145:\n"
574 " https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki\n"
575 " https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n"
576 " https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n"
577 " https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n",
604 {
RPCResult::Type::STR,
"",
"name of a rule the client must understand to some extent; see BIP 9 for format"},
608 {
RPCResult::Type::NUM,
"rulename",
"identifies the bit number as indicating acceptance and readiness for the named softfork rule"},
614 {
RPCResult::Type::NUM,
"vbrequired",
"bit mask of versionbits the server requires set in submissions"},
616 {
RPCResult::Type::ARR,
"transactions",
"contents of non-coinbase transactions that should be included in the next block",
625 {
RPCResult::Type::NUM,
"",
"transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is"},
627 {
RPCResult::Type::NUM,
"fee",
"difference in value between transaction inputs and outputs (in satoshis); 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"},
628 {
RPCResult::Type::NUM,
"sigops",
"total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero"},
629 {
RPCResult::Type::NUM,
"weight",
"total transaction weight, as counted for purposes of block limits"},
636 {
RPCResult::Type::NUM,
"coinbasevalue",
"maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)"},
637 {
RPCResult::Type::STR,
"longpollid",
"an id to include with a request to longpoll on an update to this template"},
642 {
RPCResult::Type::STR,
"value",
"A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'"},
652 {
RPCResult::Type::STR_HEX,
"default_witness_commitment",
true,
"a valid witness commitment for the unmodified block template"},
667 std::string strMode =
"template";
669 std::set<std::string> setClientRules;
670 if (!request.params[0].isNull())
676 else if (modeval.
isNull())
684 if (strMode ==
"proposal")
687 if (!dataval.
isStr())
700 return "duplicate-invalid";
701 return "duplicate-inconclusive";
706 return "inconclusive-not-best-prevblk";
715 for (
unsigned int i = 0; i < aClientRules.
size(); ++i) {
716 const UniValue& v = aClientRules[i];
717 setClientRules.insert(v.
get_str());
722 if (strMode !=
"template")
736 static unsigned int nTransactionsUpdatedLast;
742 std::chrono::steady_clock::time_point checktxtime;
743 unsigned int nTransactionsUpdatedLastLP;
748 const std::string& lpstr = lpval.
get_str();
750 hashWatchedChain =
ParseHashV(lpstr.substr(0, 64),
"longpollid");
756 hashWatchedChain = tip;
757 nTransactionsUpdatedLastLP = nTransactionsUpdatedLast;
763 checktxtime = std::chrono::steady_clock::now() + std::chrono::minutes(1);
768 if (
g_best_block_cv.wait_until(lock, checktxtime) == std::cv_status::timeout)
774 checktxtime += std::chrono::seconds(10);
790 if (consensusParams.
signet_blocks && setClientRules.count(
"signet") != 1) {
795 if (setClientRules.count(
"segwit") != 1) {
801 static int64_t time_start;
802 static std::unique_ptr<CBlockTemplate> pblocktemplate;
807 pindexPrev =
nullptr;
817 if (!pblocktemplate) {
822 pindexPrev = pindexPrevNew;
825 CBlock* pblock = &pblocktemplate->block;
828 UpdateTime(pblock, consensusParams, pindexPrev);
837 std::map<uint256, int64_t> setTxIndex;
839 for (
const auto& it : pblock->
vtx) {
842 setTxIndex[txHash] = i++;
859 entry.
pushKV(
"depends", std::move(deps));
861 int index_in_template = i - 1;
862 entry.
pushKV(
"fee", pblocktemplate->vTxFees[index_in_template]);
863 int64_t nTxSigOps = pblocktemplate->vTxSigOpsCost[index_in_template];
868 entry.
pushKV(
"sigops", nTxSigOps);
871 transactions.
push_back(std::move(entry));
884 result.
pushKV(
"capabilities", std::move(aCaps));
888 if (!fPreSegWit) aRules.
push_back(
"!segwit");
912 if (setClientRules.find(vbinfo.
name) == setClientRules.end()) {
915 pblock->
nVersion &= ~chainman.m_versionbitscache.Mask(consensusParams, pos);
925 if (setClientRules.find(vbinfo.
name) == setClientRules.end()) {
936 result.
pushKV(
"rules", std::move(aRules));
937 result.
pushKV(
"vbavailable", std::move(vbavailable));
938 result.
pushKV(
"vbrequired",
int(0));
941 result.
pushKV(
"transactions", std::move(transactions));
942 result.
pushKV(
"coinbaseaux", std::move(aux));
943 result.
pushKV(
"coinbasevalue", (int64_t)pblock->
vtx[0]->vout[0].nValue);
944 result.
pushKV(
"longpollid", tip.GetHex() + ToString(nTransactionsUpdatedLast));
947 result.
pushKV(
"mutable", std::move(aMutable));
948 result.
pushKV(
"noncerange",
"00000000ffffffff");
957 result.
pushKV(
"sigoplimit", nSigOpLimit);
958 result.
pushKV(
"sizelimit", nSizeLimit);
970 if (!pblocktemplate->vchCoinbaseCommitment.empty()) {
971 result.
pushKV(
"default_witness_commitment",
HexStr(pblocktemplate->vchCoinbaseCommitment));
1001 "\nAttempts to submit new block to network.\n"
1002 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n",
1017 std::shared_ptr<CBlock> blockptr = std::make_shared<CBlock>();
1018 CBlock& block = *blockptr;
1019 if (!
DecodeHexBlk(block, request.params[0].get_str())) {
1023 if (block.
vtx.empty() || !block.
vtx[0]->IsCoinBase()) {
1037 return "duplicate-invalid";
1054 auto sc = std::make_shared<submitblock_StateCatcher>(block.
GetHash());
1058 if (!new_block && accepted) {
1062 return "inconclusive";
1072 "\nDecode the given hexdata as a header and submit it as a candidate chain tip if valid."
1073 "\nThrows when the header is invalid.\n",
1124 for (
const auto& c : commands) {
1125 t.appendCommand(c.name, &c);
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination corresponds to one with an address.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
int64_t CAmount
Amount in satoshis (Can be negative)
double GetDifficulty(const CBlockIndex &blockindex)
Get the difficulty of the net wrt to the given block index.
@ BLOCK_VALID_SCRIPTS
Scripts & signatures ok.
const CChainParams & Params()
Return the currently selected parameters.
#define LIST_CHAIN_NAMES
List of possible chain / network names
#define CHECK_NONFATAL(condition)
Identity function.
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 EXCLUSIVE_LOCKS_REQUIRED(
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
An in-memory indexed chain of blocks.
CBlockIndex * Tip() 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.
std::string GetChainTypeString() const
Return the chain type string.
const Consensus::Params & GetConsensus() const
size_t GetNodeCount(ConnectionDirection) const
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
const Wtxid & GetWitnessHash() const LIFETIMEBOUND
const Txid & GetHash() const LIFETIMEBOUND
const std::vector< CTxIn > vin
An input of a transaction.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
void PrioritiseTransaction(const uint256 &hash, const CAmount &nFeeDelta)
Affect CreateNewBlock prioritisation of transactions.
CTransactionRef get(const uint256 &hash) const
std::vector< delta_info > GetPrioritisedTransactions() const EXCLUSIVE_LOCKS_REQUIRED(!cs)
Return a vector of all entries in mapDeltas with their corresponding delta_info.
unsigned long size() const
Implement this to subscribe to events generated in validation and mempool.
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
const util::SignalInterrupt & m_interrupt
VersionBitsCache m_versionbitscache
Track versionbit status.
const CChainParams & GetParams() const
const Consensus::Params & GetConsensus() const
CChain & ActiveChain() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex())
void MaybeRebalanceCaches() EXCLUSIVE_LOCKS_REQUIRED(void UpdateUncommittedBlockStructures(CBlock &block, const CBlockIndex *pindexPrev) const
Check to see if caches are out of balance and if so, call ResizeCoinsCaches() as needed.
bool ProcessNewBlockHeaders(const std::vector< CBlockHeader > &block, bool min_pow_checked, BlockValidationState &state, const CBlockIndex **ppindex=nullptr) LOCKS_EXCLUDED(cs_main)
Process incoming block headers.
node::BlockManager m_blockman
A single BlockManager instance is shared across each constructed chainstate to avoid duplicating bloc...
Double ended buffer combining vector and stream-like interfaces.
std::string ToString() const
auto Arg(std::string_view key) const
Helper to get a required or default-valued request argument.
auto MaybeArg(std::string_view key) const
Helper to get an optional request argument.
void push_back(UniValue val)
const std::string & get_str() const
const UniValue & find_value(std::string_view key) const
const UniValue & get_obj() const
void pushKV(std::string key, UniValue val)
std::string GetRejectReason() const
std::string ToString() const
static uint32_t Mask(const Consensus::Params ¶ms, Consensus::DeploymentPos pos)
ThresholdState State(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Get the BIP9 state for a given deployment for the block after pindexPrev.
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
Hex encoding of the number (with the most significant digits first).
Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block te...
virtual bool testBlockValidity(const CBlock &block, bool check_merkle_root, BlockValidationState &state)=0
Check a block is completely valid from start to finish.
virtual bool processNewBlock(const std::shared_ptr< const CBlock > &block, bool *new_block)=0
Processes new block.
virtual bool isInitialBlockDownload()=0
Returns whether IBD is still in progress.
virtual unsigned int getTransactionsUpdated()=0
Return the number of transaction updates in the mempool, used to decide whether to make a new block t...
virtual std::optional< uint256 > getTipHash()=0
Returns the hash for the tip of this chain.
virtual std::unique_ptr< node::CBlockTemplate > createNewBlock(const CScript &script_pub_key, const node::BlockCreateOptions &options={})=0
Construct a new block template.
virtual bool isTestChain()=0
If this chain is exclusively used for testing.
Generate a new block, without valid proof-of-work.
static std::optional< int64_t > m_last_block_num_txs
static std::optional< int64_t > m_last_block_weight
CBlockIndex * LookupBlockIndex(const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
void BlockChecked(const CBlock &block, const BlockValidationState &stateIn) override
Notifies listeners of a block validation result.
submitblock_StateCatcher(const uint256 &hashIn)
BlockValidationState state
std::string GetHex() const
static std::optional< uint256 > FromHex(std::string_view str)
static UniValue Parse(std::string_view raw)
Parse string to UniValue or throw runtime_error if string contains invalid JSON.
static int32_t GetTransactionWeight(const CTransaction &tx)
static const unsigned int MAX_BLOCK_WEIGHT
The maximum allowed weight for a block, see BIP 141 (network rule)
static const unsigned int MAX_BLOCK_SERIALIZED_SIZE
The maximum allowed size for a serialized block, in bytes (only for buffer size limits)
static const int64_t MAX_BLOCK_SIGOPS_COST
The maximum allowed number of signature check operations in a block (network rule)
static const int WITNESS_SCALE_FACTOR
std::string EncodeHexTx(const CTransaction &tx)
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
bool DecodeHexTx(CMutableTransaction &tx, const std::string &hex_tx, bool try_no_witness=false, bool try_witness=true)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS]
bool DeploymentActiveAfter(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::BuriedDeployment dep, VersionBitsCache &versionbitscache)
Determine if a deployment is active for the next block.
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
@ MAX_VERSION_BITS_DEPLOYMENTS
void RegenerateCommitments(CBlock &block, ChainstateManager &chainman)
Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed.
int64_t UpdateTime(CBlockHeader *pblock, const Consensus::Params &consensusParams, const CBlockIndex *pindexPrev)
UniValue GetWarningsForRpc(const Warnings &warnings, bool use_deprecated)
RPC helper function that wraps warnings.GetMessages().
std::string ToString(const T &t)
Locale-independent version of std::to_string.
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params ¶ms)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
static constexpr TransactionSerParams TX_WITH_WITNESS
static CTransactionRef MakeTransactionRef(Tx &&txIn)
UniValue JSONRPCError(int code, const std::string &message)
static UniValue generateBlocks(ChainstateManager &chainman, Mining &miner, const CScript &coinbase_script, int nGenerate, uint64_t nMaxTries)
static UniValue GetNetworkHashPS(int lookup, int height, const CChain &active_chain)
Return average network hashes per second based on the last 'lookup' blocks, or from the last difficul...
static RPCHelpMan generateblock()
static RPCHelpMan generatetodescriptor()
static bool getScriptFromDescriptor(const std::string &descriptor, CScript &script, std::string &error)
static RPCHelpMan getnetworkhashps()
static RPCHelpMan getprioritisedtransactions()
static UniValue BIP22ValidationResult(const BlockValidationState &state)
static RPCHelpMan submitblock()
static RPCHelpMan getblocktemplate()
static bool GenerateBlock(ChainstateManager &chainman, Mining &miner, CBlock &block, uint64_t &max_tries, std::shared_ptr< const CBlock > &block_out, bool process_new_block)
static RPCHelpMan generate()
static RPCHelpMan submitheader()
static RPCHelpMan prioritisetransaction()
static RPCHelpMan getmininginfo()
static RPCHelpMan generatetoaddress()
static std::string gbt_vb_name(const Consensus::DeploymentPos pos)
void RegisterMiningRPCCommands(CRPCTable &t)
static const uint64_t DEFAULT_MAX_TRIES
Default max iterations to try in RPC generatetodescriptor, generatetoaddress, and generateblock.
@ RPC_OUT_OF_MEMORY
Ran out of memory during operation.
@ RPC_MISC_ERROR
General application defined errors.
@ RPC_TYPE_ERROR
Unexpected type was passed as parameter.
@ RPC_CLIENT_NOT_CONNECTED
P2P client errors.
@ RPC_INVALID_PARAMETER
Invalid, missing or duplicate parameter.
@ RPC_VERIFY_ERROR
General error during transaction or block submission.
@ RPC_CLIENT_IN_INITIAL_DOWNLOAD
Still downloading initial blocks.
@ RPC_DESERIALIZATION_ERROR
Error parsing or validating structure in raw format.
@ RPC_INVALID_ADDRESS_OR_KEY
Invalid address or key.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
const std::string UNIX_EPOCH_TIME
String used to describe UNIX epoch time in documentation, factored out to a constant for consistency.
uint256 ParseHashV(const UniValue &v, std::string_view name)
Utilities: convert hex-encoded Values (throws error if not hex).
bool IsDeprecatedRPCEnabled(const std::string &method)
bool IsRPCRunning()
Query whether RPC is running.
ChainstateManager & EnsureAnyChainman(const std::any &context)
NodeContext & EnsureAnyNodeContext(const std::any &context)
CTxMemPool & EnsureMemPool(const NodeContext &node)
ChainstateManager & EnsureChainman(const NodeContext &node)
CTxMemPool & EnsureAnyMemPool(const std::any &context)
interfaces::Mining & EnsureMining(const NodeContext &node)
CConnman & EnsureConnman(const NodeContext &node)
T LocaleIndependentAtoi(std::string_view str)
A mutable version of CTransaction.
int bit
Bit position to select the particular bit in nVersion.
Parameters that influence chain consensus.
std::vector< uint8_t > signet_challenge
int64_t DifficultyAdjustmentInterval() const
bool signet_blocks
If true, witness commitments contain a payload equal to a Bitcoin Script solution to the signet chall...
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
@ STR_HEX
Special type that is a STR with only hex chars.
std::string DefaultHint
Hint for default value.
@ OMITTED
Optional argument for which the default value is omitted from help text for one of two reasons:
@ NUM_TIME
Special numeric to denote unix epoch time.
@ OBJ_DYN
Special dictionary with keys that are not literals.
@ STR_HEX
Special string with only hex chars.
bool gbt_force
Whether GBT clients can safely ignore this rule in simplified usage.
const char * name
Deployment name.
ValidationSignals * signals
NodeContext struct containing references to chain state and connection state.
#define WAIT_LOCK(cs, name)
#define ENTER_CRITICAL_SECTION(cs)
#define LEAVE_CRITICAL_SECTION(cs)
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
const UniValue NullUniValue
GlobalMutex g_best_block_mutex
std::condition_variable g_best_block_cv
uint256 g_best_block
Used to notify getblocktemplate RPC of new tips.
ThresholdState
BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages.