Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

mining.cpp File Reference
#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>
+ Include dependency graph for mining.cpp:

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()

◆ estimatefee()

◆ estimaterawfee()

◆ estimatesmartfee()

◆ gbt_vb_name()

std::string gbt_vb_name ( const Consensus::DeploymentPos  pos)

◆ 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()

◆ 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()

◆ ParseConfirmTarget()

unsigned int ParseConfirmTarget ( const UniValue value)

◆ prioritisetransaction()

◆ 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()

Variable Documentation

◆ commands

const CRPCCommand commands[]
static
Initial value:
=
{
{ "mining", "getnetworkhashps", &getnetworkhashps, {"nblocks","height"} },
{ "mining", "getmininginfo", &getmininginfo, {} },
{ "mining", "prioritisetransaction", &prioritisetransaction, {"txid","fee_delta"} },
{ "mining", "getblocktemplate", &getblocktemplate, {"template_request"} },
{ "mining", "submitblock", &submitblock, {"hexdata","dummy"} },
{ "util", "estimatefee", &estimatefee, {"nblocks"} },
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
}
UniValue estimaterawfee(const JSONRPCRequest &request)
Definition: mining.cpp:900
UniValue prioritisetransaction(const JSONRPCRequest &request)
Definition: mining.cpp:244
UniValue estimatesmartfee(const JSONRPCRequest &request)
Definition: mining.cpp:840
UniValue estimatefee(const JSONRPCRequest &request)
Definition: mining.cpp:800
UniValue getmininginfo(const JSONRPCRequest &request)
Definition: mining.cpp:200
UniValue getblocktemplate(const JSONRPCRequest &request)
Definition: mining.cpp:300
UniValue submitblock(const JSONRPCRequest &request)
Definition: mining.cpp:737
UniValue getnetworkhashps(const JSONRPCRequest &request)
Definition: mining.cpp:94

Definition at line 1001 of file mining.cpp.

Referenced by RegisterMiningRPCCommands().

Released under the MIT license