Raven Core  3.0.0
P2P Digital Currency
Classes | Functions
blockchain.cpp File Reference
#include "rpc/blockchain.h"
#include "amount.h"
#include "base58.h"
#include "chain.h"
#include "chainparams.h"
#include "checkpoints.h"
#include "coins.h"
#include "consensus/validation.h"
#include "validation.h"
#include "core_io.h"
#include "policy/feerate.h"
#include "policy/policy.h"
#include "primitives/transaction.h"
#include "rpc/server.h"
#include "script/script.h"
#include "script/script_error.h"
#include "script/sign.h"
#include "script/standard.h"
#include "streams.h"
#include "sync.h"
#include "txdb.h"
#include "txmempool.h"
#include "util.h"
#include "utilstrencodings.h"
#include "hash.h"
#include "warnings.h"
#include <stdint.h>
#include <univalue.h>
#include <boost/thread/thread.hpp>
#include <mutex>
#include <condition_variable>
Include dependency graph for blockchain.cpp:

Go to the source code of this file.

Classes

struct  CUpdatedBlock
 
struct  CCoinsStats
 
struct  CompareBlocksByHeight
 Comparison function for sorting the getchaintips heads. More...
 

Functions

void TxToJSON (const CTransaction &tx, const uint256 hashBlock, UniValue &entry)
 
double GetDifficulty (const CBlockIndex *blockindex)
 Get the difficulty of the net wrt to the given block index, or the chain tip if not provided. More...
 
UniValue blockheaderToJSON (const CBlockIndex *blockindex)
 Block header to JSON. More...
 
UniValue blockToDeltasJSON (const CBlock &block, const CBlockIndex *blockindex)
 
UniValue blockToJSON (const CBlock &block, const CBlockIndex *blockindex, bool txDetails)
 Block description to JSON. More...
 
UniValue getblockcount (const JSONRPCRequest &request)
 
UniValue getbestblockhash (const JSONRPCRequest &request)
 
void RPCNotifyBlockChange (bool ibd, const CBlockIndex *pindex)
 Callback for when block tip changed. More...
 
UniValue waitfornewblock (const JSONRPCRequest &request)
 
UniValue waitforblock (const JSONRPCRequest &request)
 
UniValue waitforblockheight (const JSONRPCRequest &request)
 
UniValue getdifficulty (const JSONRPCRequest &request)
 
std::string EntryDescriptionString ()
 
void entryToJSON (UniValue &info, const CTxMemPoolEntry &e)
 
UniValue mempoolToJSON (bool fVerbose)
 Mempool to JSON. More...
 
UniValue getrawmempool (const JSONRPCRequest &request)
 
UniValue getmempoolancestors (const JSONRPCRequest &request)
 
UniValue getmempooldescendants (const JSONRPCRequest &request)
 
UniValue getmempoolentry (const JSONRPCRequest &request)
 
UniValue getblockdeltas (const JSONRPCRequest &request)
 
UniValue getblockhashes (const JSONRPCRequest &request)
 
UniValue getblockhash (const JSONRPCRequest &request)
 
UniValue getblockheader (const JSONRPCRequest &request)
 
UniValue getblock (const JSONRPCRequest &request)
 
UniValue pruneblockchain (const JSONRPCRequest &request)
 
UniValue gettxoutsetinfo (const JSONRPCRequest &request)
 
UniValue gettxout (const JSONRPCRequest &request)
 
UniValue verifychain (const JSONRPCRequest &request)
 
void BIP9SoftForkDescPushBack (UniValue &bip9_softforks, const std::string &name, const Consensus::Params &consensusParams, Consensus::DeploymentPos id)
 
UniValue getblockchaininfo (const JSONRPCRequest &request)
 
UniValue getchaintips (const JSONRPCRequest &request)
 
UniValue mempoolInfoToJSON ()
 Mempool information to JSON. More...
 
UniValue getmempoolinfo (const JSONRPCRequest &request)
 
UniValue preciousblock (const JSONRPCRequest &request)
 
UniValue invalidateblock (const JSONRPCRequest &request)
 
UniValue reconsiderblock (const JSONRPCRequest &request)
 
UniValue getchaintxstats (const JSONRPCRequest &request)
 
UniValue savemempool (const JSONRPCRequest &request)
 
void RegisterBlockchainRPCCommands (CRPCTable &t)
 Register block chain RPC commands. More...
 

Function Documentation

◆ BIP9SoftForkDescPushBack()

void BIP9SoftForkDescPushBack ( UniValue bip9_softforks,
const std::string &  name,
const Consensus::Params consensusParams,
Consensus::DeploymentPos  id 
)

Definition at line 1322 of file blockchain.cpp.

Here is the call graph for this function:

◆ blockheaderToJSON()

UniValue blockheaderToJSON ( const CBlockIndex blockindex)

Block header to JSON.

Definition at line 85 of file blockchain.cpp.

Here is the call graph for this function:

◆ blockToDeltasJSON()

UniValue blockToDeltasJSON ( const CBlock block,
const CBlockIndex blockindex 
)

Definition at line 113 of file blockchain.cpp.

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

◆ blockToJSON()

UniValue blockToJSON ( const CBlock block,
const CBlockIndex blockindex,
bool  txDetails 
)

Block description to JSON.

Definition at line 219 of file blockchain.cpp.

Here is the call graph for this function:

◆ EntryDescriptionString()

std::string EntryDescriptionString ( )

Definition at line 446 of file blockchain.cpp.

Here is the caller graph for this function:

◆ entryToJSON()

void entryToJSON ( UniValue info,
const CTxMemPoolEntry e 
)

Definition at line 465 of file blockchain.cpp.

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

◆ getbestblockhash()

UniValue getbestblockhash ( const JSONRPCRequest request)

Definition at line 280 of file blockchain.cpp.

Here is the call graph for this function:

◆ getblock()

UniValue getblock ( const JSONRPCRequest request)

Definition at line 899 of file blockchain.cpp.

Here is the call graph for this function:

◆ getblockchaininfo()

UniValue getblockchaininfo ( const JSONRPCRequest request)

Definition at line 1331 of file blockchain.cpp.

Here is the call graph for this function:

◆ getblockcount()

UniValue getblockcount ( const JSONRPCRequest request)

Definition at line 263 of file blockchain.cpp.

Here is the call graph for this function:

◆ getblockdeltas()

UniValue getblockdeltas ( const JSONRPCRequest request)

Definition at line 719 of file blockchain.cpp.

Here is the call graph for this function:

◆ getblockhash()

UniValue getblockhash ( const JSONRPCRequest request)

Definition at line 815 of file blockchain.cpp.

Here is the call graph for this function:

◆ getblockhashes()

UniValue getblockhashes ( const JSONRPCRequest request)

Definition at line 742 of file blockchain.cpp.

Here is the call graph for this function:

◆ getblockheader()

UniValue getblockheader ( const JSONRPCRequest request)

Definition at line 840 of file blockchain.cpp.

Here is the call graph for this function:

◆ getchaintips()

UniValue getchaintips ( const JSONRPCRequest request)

Definition at line 1456 of file blockchain.cpp.

Here is the call graph for this function:

◆ getchaintxstats()

UniValue getchaintxstats ( const JSONRPCRequest request)

Definition at line 1707 of file blockchain.cpp.

Here is the call graph for this function:

◆ GetDifficulty()

double GetDifficulty ( const CBlockIndex blockindex = nullptr)

Get the difficulty of the net wrt to the given block index, or the chain tip if not provided.

Returns
A floating point number that is a multiple of the main net minimum difficulty (4295032833 hashes).

Definition at line 56 of file blockchain.cpp.

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

◆ getdifficulty()

UniValue getdifficulty ( const JSONRPCRequest request)

Definition at line 429 of file blockchain.cpp.

Here is the call graph for this function:

◆ getmempoolancestors()

UniValue getmempoolancestors ( const JSONRPCRequest request)

Definition at line 558 of file blockchain.cpp.

Here is the call graph for this function:

◆ getmempooldescendants()

UniValue getmempooldescendants ( const JSONRPCRequest request)

Definition at line 622 of file blockchain.cpp.

Here is the call graph for this function:

◆ getmempoolentry()

UniValue getmempoolentry ( const JSONRPCRequest request)

Definition at line 686 of file blockchain.cpp.

Here is the call graph for this function:

◆ getmempoolinfo()

UniValue getmempoolinfo ( const JSONRPCRequest request)

Definition at line 1572 of file blockchain.cpp.

Here is the call graph for this function:

◆ getrawmempool()

UniValue getrawmempool ( const JSONRPCRequest request)

Definition at line 526 of file blockchain.cpp.

Here is the call graph for this function:

◆ gettxout()

UniValue gettxout ( const JSONRPCRequest request)

Definition at line 1152 of file blockchain.cpp.

Here is the call graph for this function:

◆ gettxoutsetinfo()

UniValue gettxoutsetinfo ( const JSONRPCRequest request)

Definition at line 1110 of file blockchain.cpp.

Here is the call graph for this function:

◆ invalidateblock()

UniValue invalidateblock ( const JSONRPCRequest request)

Definition at line 1632 of file blockchain.cpp.

Here is the call graph for this function:

◆ mempoolInfoToJSON()

UniValue mempoolInfoToJSON ( )

Mempool information to JSON.

Definition at line 1559 of file blockchain.cpp.

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

◆ mempoolToJSON()

UniValue mempoolToJSON ( bool  fVerbose)

Mempool to JSON.

Definition at line 498 of file blockchain.cpp.

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

◆ preciousblock()

UniValue preciousblock ( const JSONRPCRequest request)

Definition at line 1594 of file blockchain.cpp.

Here is the call graph for this function:

◆ pruneblockchain()

UniValue pruneblockchain ( const JSONRPCRequest request)

Definition at line 1061 of file blockchain.cpp.

Here is the call graph for this function:

◆ reconsiderblock()

UniValue reconsiderblock ( const JSONRPCRequest request)

Definition at line 1670 of file blockchain.cpp.

Here is the call graph for this function:

◆ RegisterBlockchainRPCCommands()

void RegisterBlockchainRPCCommands ( CRPCTable t)

Register block chain RPC commands.

Definition at line 1840 of file blockchain.cpp.

Here is the call graph for this function:

◆ RPCNotifyBlockChange()

void RPCNotifyBlockChange ( bool  ibd,
const CBlockIndex  
)

Callback for when block tip changed.

Definition at line 297 of file blockchain.cpp.

Here is the caller graph for this function:

◆ savemempool()

UniValue savemempool ( const JSONRPCRequest request)

Definition at line 1786 of file blockchain.cpp.

Here is the call graph for this function:

◆ TxToJSON()

void TxToJSON ( const CTransaction tx,
const uint256  hashBlock,
UniValue entry 
)

◆ verifychain()

UniValue verifychain ( const JSONRPCRequest request)

Definition at line 1232 of file blockchain.cpp.

Here is the call graph for this function:

◆ waitforblock()

UniValue waitforblock ( const JSONRPCRequest request)

Definition at line 345 of file blockchain.cpp.

Here is the call graph for this function:

◆ waitforblockheight()

UniValue waitforblockheight ( const JSONRPCRequest request)

Definition at line 387 of file blockchain.cpp.

Here is the call graph for this function:

◆ waitfornewblock()

UniValue waitfornewblock ( const JSONRPCRequest request)

Definition at line 307 of file blockchain.cpp.

Here is the call graph for this function: