Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <base58.h>
#include <amount.h>
#include <chain.h>
#include <chainparams.h>
#include <consensus/consensus.h>
#include <consensus/params.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <init.h>
#include <validation.h>
#include <miner.h>
#include <net.h>
#include <policy/fees.h>
#include <pow.h>
#include <rpc/blockchain.h>
#include <rpc/mining.h>
#include <rpc/server.h>
#include <spork.h>
#include <txmempool.h>
#include <util.h>
#include <utilstrencodings.h>
#include <validationinterface.h>
#include <warnings.h>
#include <governance/governance-classes.h>
#include <masternode/masternode-payments.h>
#include <masternode/masternode-sync.h>
#include <evo/deterministicmns.h>
#include <evo/specialtx.h>
#include <evo/cbtx.h>
#include <memory>
#include <stdint.h>
Go to the source code of this file.
Classes | |
class | submitblock_StateCatcher |
Functions | |
unsigned int | ParseConfirmTarget (const UniValue &value) |
Check bounds on a command line confirm target. More... | |
UniValue | GetNetworkHashPS (int lookup, int height) |
Return average network hashes per second based on the last 'lookup' blocks, or from the last difficulty change if 'lookup' is nonpositive. More... | |
UniValue | getnetworkhashps (const JSONRPCRequest &request) |
UniValue | getmininginfo (const JSONRPCRequest &request) |
UniValue | prioritisetransaction (const JSONRPCRequest &request) |
static UniValue | BIP22ValidationResult (const CValidationState &state) |
std::string | gbt_vb_name (const Consensus::DeploymentPos pos) |
UniValue | getblocktemplate (const JSONRPCRequest &request) |
UniValue | submitblock (const JSONRPCRequest &request) |
UniValue | estimatefee (const JSONRPCRequest &request) |
UniValue | estimatesmartfee (const JSONRPCRequest &request) |
UniValue | estimaterawfee (const JSONRPCRequest &request) |
void | RegisterMiningRPCCommands (CRPCTable &t) |
Register mining RPC commands. More... | |
Variables | |
static const CRPCCommand | commands [] |
Function Documentation
◆ BIP22ValidationResult()
|
static |
Definition at line 273 of file mining.cpp.
References CValidationState::GetRejectReason(), CValidationState::IsError(), CValidationState::IsInvalid(), CValidationState::IsValid(), JSONRPCError(), NullUniValue, and RPC_VERIFY_ERROR.
Referenced by getblocktemplate(), and submitblock().
◆ estimatefee()
UniValue estimatefee | ( | const JSONRPCRequest & | request | ) |
Definition at line 800 of file mining.cpp.
References CBlockPolicyEstimator::estimateFee(), feeEstimator, JSONRPCRequest::fHelp, UniValue::get_int(), CFeeRate::GetFeePerK(), HelpExampleCli(), IsDeprecatedRPCEnabled(), JSONRPCError(), JSONRPCRequest::params, RPC_METHOD_DEPRECATED, RPCTypeCheck(), UniValue::size(), and ValueFromAmount().
◆ estimaterawfee()
UniValue estimaterawfee | ( | const JSONRPCRequest & | request | ) |
Definition at line 900 of file mining.cpp.
References CURRENCY_UNIT, EstimationResult::decay, EstimatorBucket::end, CBlockPolicyEstimator::estimateRawFee(), EstimationResult::fail, feeEstimator, JSONRPCRequest::fHelp, UniValue::get_real(), CFeeRate::GetFeePerK(), HelpExampleCli(), CBlockPolicyEstimator::HighestTargetTracked(), EstimatorBucket::inMempool, UniValue::isNull(), JSONRPCError(), EstimatorBucket::leftMempool, LONG_HALFLIFE, MED_HALFLIFE, Pair(), JSONRPCRequest::params, ParseConfirmTarget(), EstimationResult::pass, UniValue::push_back(), RPC_INVALID_PARAMETER, RPCTypeCheck(), RPCTypeCheckArgument(), EstimationResult::scale, SHORT_HALFLIFE, UniValue::size(), EstimatorBucket::start, StringForFeeEstimateHorizon(), EstimatorBucket::totalConfirmed, ValueFromAmount(), UniValue::VARR, UniValue::VNUM, UniValue::VOBJ, and EstimatorBucket::withinTarget.
◆ estimatesmartfee()
UniValue estimatesmartfee | ( | const JSONRPCRequest & | request | ) |
Definition at line 840 of file mining.cpp.
References CURRENCY_UNIT, ECONOMICAL, CBlockPolicyEstimator::estimateSmartFee(), feeEstimator, FeeModeFromString(), JSONRPCRequest::fHelp, UniValue::get_str(), CFeeRate::GetFeePerK(), HelpExampleCli(), UniValue::isNull(), JSONRPCError(), Pair(), JSONRPCRequest::params, ParseConfirmTarget(), UniValue::push_back(), FeeCalculation::returnedTarget, RPC_INVALID_PARAMETER, RPCTypeCheck(), RPCTypeCheckArgument(), UniValue::size(), ValueFromAmount(), UniValue::VARR, UniValue::VNUM, and UniValue::VOBJ.
◆ gbt_vb_name()
std::string gbt_vb_name | ( | const Consensus::DeploymentPos | pos | ) |
Definition at line 291 of file mining.cpp.
References VBDeploymentInfo::gbt_force, VBDeploymentInfo::name, and VersionBitsDeploymentInfo.
Referenced by getblocktemplate().
◆ getblocktemplate()
UniValue getblocktemplate | ( | const JSONRPCRequest & | request | ) |
Definition at line 300 of file mining.cpp.
References atoi64(), prevector< N, T, Size, Diff >::begin(), BIP22ValidationResult(), Consensus::BIP9Deployment::bit, BLOCK_FAILED_MASK, BLOCK_VALID_SCRIPTS, chainActive, COINBASE_FLAGS, CConnman::CONNECTIONS_ALL, BlockAssembler::CreateNewBlock(), cs_main, DecodeHexBlk(), EncodeDestination(), EncodeHexTx(), prevector< N, T, Size, Diff >::end(), ENTER_CRITICAL_SECTION, ExtractDestination(), fDIP0001ActiveAtTip, JSONRPCRequest::fHelp, find_value(), g_best_block, g_best_block_cv, g_best_block_mutex, g_connman, VBDeploymentInfo::gbt_force, gbt_vb_name(), UniValue::get_int64(), UniValue::get_obj(), UniValue::get_str(), CBlockIndex::GetBlockHash(), CBlockHeader::GetBlockTime(), CMasternodePayments::GetBlockTxOuts(), CChainParams::GetConsensus(), CBlockHeader::GetHash(), CTransaction::GetHash(), base_blob< BITS >::GetHex(), base_uint< BITS >::GetHex(), CBlockIndex::GetMedianTimePast(), GetTime(), CTxMemPool::GetTransactionsUpdated(), COutPoint::hash, CBlockHeader::hashPrevBlock, CChain::Height(), HelpExampleCli(), HelpExampleRpc(), HexStr(), i64tostr(), UniValue::isArray(), CTransaction::IsCoinBase(), IsInitialBlockDownload(), UniValue::isNull(), UniValue::isNum(), IsRPCRunning(), CSporkManager::IsSporkActive(), UniValue::isStr(), CMasternodeSync::IsSynced(), CBlockIndex::IsValid(), CSuperblock::IsValidBlockHeight(), JSONRPCError(), LEAVE_CRITICAL_SECTION, LOCK, mapBlockIndex, masternodeSync, Consensus::MAX_VERSION_BITS_DEPLOYMENTS, MaxBlockSigOps(), MaxBlockSize(), mempool, mnpayments, VBDeploymentInfo::name, CBlockHeader::nBits, CBlockIndex::nHeight, Consensus::Params::nMasternodePaymentsStartBlock, CBlockHeader::nNonce, CBlockIndex::nStatus, Consensus::Params::nSuperblockStartBlock, NullUniValue, CBlockHeader::nVersion, OP_TRUE, Pair(), JSONRPCRequest::params, Params(), CTxIn::prevout, UniValue::push_back(), RPC_CLIENT_IN_INITIAL_DOWNLOAD, RPC_CLIENT_NOT_CONNECTED, RPC_CLIENT_P2P_DISABLED, RPC_DESERIALIZATION_ERROR, RPC_INVALID_PARAMETER, RPC_OUT_OF_MEMORY, RPC_TYPE_ERROR, arith_uint256::SetCompact(), base_blob< BITS >::SetHex(), UniValue::size(), SPORK_9_SUPERBLOCKS_ENABLED, sporkManager, strprintf, TestBlockValidity(), THRESHOLD_ACTIVE, THRESHOLD_DEFINED, THRESHOLD_FAILED, THRESHOLD_LOCKED_IN, THRESHOLD_STARTED, CChain::Tip(), UpdateTime(), UniValue::VARR, Consensus::Params::vDeployments, versionbitscache, VersionBitsDeploymentInfo, VersionBitsMask(), VersionBitsState(), CTransaction::vin, UniValue::VOBJ, and CBlock::vtx.
◆ getmininginfo()
UniValue getmininginfo | ( | const JSONRPCRequest & | request | ) |
Definition at line 200 of file mining.cpp.
References chainActive, cs_main, JSONRPCRequest::fHelp, GetDifficulty(), getnetworkhashps(), GetWarnings(), CChain::Height(), HelpExampleCli(), HelpExampleRpc(), IsDeprecatedRPCEnabled(), LOCK, mempool, nLastBlockSize, nLastBlockTx, Pair(), JSONRPCRequest::params, Params(), UniValue::push_back(), UniValue::size(), CTxMemPool::size(), and UniValue::VOBJ.
◆ GetNetworkHashPS()
UniValue GetNetworkHashPS | ( | int | lookup, |
int | height | ||
) |
Return average network hashes per second based on the last 'lookup' blocks, or from the last difficulty change if 'lookup' is nonpositive.
If 'height' is nonnegative, compute the estimate at the time when a given block was found.
Definition at line 57 of file mining.cpp.
References chainActive, Consensus::Params::DifficultyAdjustmentInterval(), CBlockIndex::GetBlockTime(), CChainParams::GetConsensus(), base_uint< BITS >::getdouble(), CChain::Height(), CBlockIndex::nChainWork, CBlockIndex::nHeight, Params(), CBlockIndex::pprev, and CChain::Tip().
Referenced by getnetworkhashps().
◆ getnetworkhashps()
UniValue getnetworkhashps | ( | const JSONRPCRequest & | request | ) |
Definition at line 94 of file mining.cpp.
References cs_main, JSONRPCRequest::fHelp, UniValue::get_int(), GetNetworkHashPS(), HelpExampleCli(), HelpExampleRpc(), UniValue::isNull(), LOCK, JSONRPCRequest::params, and UniValue::size().
Referenced by getmininginfo().
◆ ParseConfirmTarget()
unsigned int ParseConfirmTarget | ( | const UniValue & | value | ) |
Check bounds on a command line confirm target.
Definition at line 42 of file mining.cpp.
References feeEstimator, UniValue::get_int(), CBlockPolicyEstimator::HighestTargetTracked(), JSONRPCError(), LONG_HALFLIFE, RPC_INVALID_PARAMETER, and strprintf.
Referenced by estimaterawfee(), estimatesmartfee(), fundrawtransaction(), sendmany(), and sendtoaddress().
◆ prioritisetransaction()
UniValue prioritisetransaction | ( | const JSONRPCRequest & | request | ) |
Definition at line 244 of file mining.cpp.
References cs_main, JSONRPCRequest::fHelp, UniValue::get_int64(), UniValue::get_str(), HelpExampleCli(), HelpExampleRpc(), LOCK, mempool, JSONRPCRequest::params, ParseHashStr(), CTxMemPool::PrioritiseTransaction(), and UniValue::size().
◆ RegisterMiningRPCCommands()
void RegisterMiningRPCCommands | ( | CRPCTable & | t | ) |
Register mining RPC commands.
Definition at line 1020 of file mining.cpp.
References CRPCTable::appendCommand(), ARRAYLEN, commands, and CRPCCommand::name.
Referenced by RegisterAllCoreRPCCommands().
◆ submitblock()
UniValue submitblock | ( | const JSONRPCRequest & | request | ) |
Definition at line 737 of file mining.cpp.
References BIP22ValidationResult(), BLOCK_FAILED_MASK, BLOCK_VALID_SCRIPTS, cs_main, DecodeHexBlk(), JSONRPCRequest::fHelp, UniValue::get_str(), HelpExampleCli(), HelpExampleRpc(), CBlockIndex::IsValid(), JSONRPCError(), LOCK, mapBlockIndex, CBlockIndex::nStatus, JSONRPCRequest::params, Params(), ProcessNewBlock(), RegisterValidationInterface(), RPC_DESERIALIZATION_ERROR, UniValue::size(), and UnregisterValidationInterface().
Variable Documentation
◆ commands
|
static |
Definition at line 1001 of file mining.cpp.
Referenced by RegisterMiningRPCCommands().