Bitcoin Core  0.19.99
P2P Digital Currency
Classes | Functions | Variables
mining.cpp File Reference
#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 <key_io.h>
#include <miner.h>
#include <net.h>
#include <node/context.h>
#include <policy/fees.h>
#include <pow.h>
#include <rpc/blockchain.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <script/script.h>
#include <script/signingprovider.h>
#include <shutdown.h>
#include <txmempool.h>
#include <univalue.h>
#include <util/fees.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/system.h>
#include <validation.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.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

static 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...
 
static UniValue getnetworkhashps (const JSONRPCRequest &request)
 
static UniValue generateBlocks (const CTxMemPool &mempool, const CScript &coinbase_script, int nGenerate, uint64_t nMaxTries)
 
static UniValue generatetodescriptor (const JSONRPCRequest &request)
 
static UniValue generatetoaddress (const JSONRPCRequest &request)
 
static UniValue getmininginfo (const JSONRPCRequest &request)
 
static UniValue prioritisetransaction (const JSONRPCRequest &request)
 
static UniValue BIP22ValidationResult (const BlockValidationState &state)
 
static std::string gbt_vb_name (const Consensus::DeploymentPos pos)
 
static UniValue getblocktemplate (const JSONRPCRequest &request)
 
static UniValue submitblock (const JSONRPCRequest &request)
 
static UniValue submitheader (const JSONRPCRequest &request)
 
static UniValue estimatesmartfee (const JSONRPCRequest &request)
 
static UniValue estimaterawfee (const JSONRPCRequest &request)
 
void RegisterMiningRPCCommands (CRPCTable &t)
 Register mining RPC commands. More...
 

Variables

static const CRPCCommand commands []
 

Function Documentation

◆ BIP22ValidationResult()

static UniValue BIP22ValidationResult ( const BlockValidationState state)
static

Definition at line 308 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ estimaterawfee()

static UniValue estimaterawfee ( const JSONRPCRequest request)
static

Definition at line 909 of file mining.cpp.

Here is the call graph for this function:

◆ estimatesmartfee()

static UniValue estimatesmartfee ( const JSONRPCRequest request)
static

Definition at line 844 of file mining.cpp.

Here is the call graph for this function:

◆ gbt_vb_name()

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

Definition at line 326 of file mining.cpp.

Here is the caller graph for this function:

◆ generateBlocks()

static UniValue generateBlocks ( const CTxMemPool mempool,
const CScript coinbase_script,
int  nGenerate,
uint64_t  nMaxTries 
)
static

Definition at line 104 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generatetoaddress()

static UniValue generatetoaddress ( const JSONRPCRequest request)
static

Definition at line 192 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generatetodescriptor()

static UniValue generatetodescriptor ( const JSONRPCRequest request)
static

Definition at line 145 of file mining.cpp.

Here is the call graph for this function:

◆ getblocktemplate()

static UniValue getblocktemplate ( const JSONRPCRequest request)
static

Definition at line 335 of file mining.cpp.

◆ getmininginfo()

static UniValue getmininginfo ( const JSONRPCRequest request)
static

Definition at line 232 of file mining.cpp.

Here is the call graph for this function:

◆ GetNetworkHashPS()

static UniValue GetNetworkHashPS ( int  lookup,
int  height 
)
static

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 45 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getnetworkhashps()

static UniValue getnetworkhashps ( const JSONRPCRequest request)
static

Definition at line 82 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prioritisetransaction()

static UniValue prioritisetransaction ( const JSONRPCRequest request)
static

Definition at line 272 of file mining.cpp.

Here is the call graph for this function:

◆ RegisterMiningRPCCommands()

void RegisterMiningRPCCommands ( CRPCTable t)

Register mining RPC commands.

Definition at line 1046 of file mining.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ submitblock()

static UniValue submitblock ( const JSONRPCRequest request)
static

Definition at line 745 of file mining.cpp.

Here is the call graph for this function:

◆ submitheader()

static UniValue submitheader ( const JSONRPCRequest request)
static

Definition at line 808 of file mining.cpp.

Here is the call graph for this function:

Variable Documentation

◆ commands

const CRPCCommand commands[]
static
Initial value:
=
{
{ "mining", "getnetworkhashps", &getnetworkhashps, {"nblocks","height"} },
{ "mining", "getmininginfo", &getmininginfo, {} },
{ "mining", "prioritisetransaction", &prioritisetransaction, {"txid","dummy","fee_delta"} },
{ "mining", "getblocktemplate", &getblocktemplate, {"template_request"} },
{ "mining", "submitblock", &submitblock, {"hexdata","dummy"} },
{ "mining", "submitheader", &submitheader, {"hexdata"} },
{ "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
{ "generating", "generatetodescriptor", &generatetodescriptor, {"num_blocks","descriptor","maxtries"} },
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
}
static UniValue generatetodescriptor(const JSONRPCRequest &request)
Definition: mining.cpp:145
static UniValue getnetworkhashps(const JSONRPCRequest &request)
Definition: mining.cpp:82
static UniValue submitblock(const JSONRPCRequest &request)
Definition: mining.cpp:745
static UniValue generatetoaddress(const JSONRPCRequest &request)
Definition: mining.cpp:192
static UniValue prioritisetransaction(const JSONRPCRequest &request)
Definition: mining.cpp:272
static UniValue estimatesmartfee(const JSONRPCRequest &request)
Definition: mining.cpp:844
static UniValue getmininginfo(const JSONRPCRequest &request)
Definition: mining.cpp:232
static UniValue getblocktemplate(const JSONRPCRequest &request)
Definition: mining.cpp:335
static UniValue submitheader(const JSONRPCRequest &request)
Definition: mining.cpp:808
static UniValue estimaterawfee(const JSONRPCRequest &request)
Definition: mining.cpp:909

Definition at line 1026 of file mining.cpp.