BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
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 <index/txindex.h>
#include <key_io.h>
#include <policy/feerate.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <primitives/transaction.h>
#include <rpc/server.h>
#include <script/descriptor.h>
#include <streams.h>
#include <sync.h>
#include <txdb.h>
#include <txmempool.h>
#include <util.h>
#include <utilstrencodings.h>
#include <hash.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.h>
#include <assert.h>
#include <stdint.h>
#include <univalue.h>
#include <boost/algorithm/string.hpp>
#include <boost/thread/thread.hpp>
#include <memory>
#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...
 
class  CoinsViewScanReserver
 

Functions

double GetDifficulty (const CBlockIndex *blockindex)
 Get the difficulty of the net wrt to the given block index. More...
 
UniValue blockheaderToJSON (const CBlockIndex *blockindex)
 Block header to JSON. More...
 
UniValue blockToJSON (const CBlock &block, const CBlockIndex *blockindex, bool txDetails)
 Block description to JSON. More...
 
void RPCNotifyBlockChange (bool ibd, const CBlockIndex *pindex)
 Callback for when block tip changed. More...
 
UniValue mempoolToJSON (bool fVerbose)
 Mempool to JSON. More...
 
UniValue gettxout (const JSONRPCRequest &request)
 
UniValue getblockchaininfo (const JSONRPCRequest &request)
 Implementation of IsSuperMajority with better feedback. More...
 
UniValue mempoolInfoToJSON ()
 Mempool information to JSON. More...
 
void CalculatePercentilesByWeight (CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector< std::pair< CAmount, int64_t >> &scores, int64_t total_weight)
 Used by getblockstats to get feerates at different percentiles by weight. More...
 
bool FindScriptPubKey (std::atomic< int > &scan_progress, const std::atomic< bool > &should_abort, int64_t &count, CCoinsViewCursor *cursor, const std::set< CScript > &needles, std::map< COutPoint, Coin > &out_results)
 Search for a given set of pubkey scripts. More...
 
UniValue scantxoutset (const JSONRPCRequest &request)
 
void RegisterBlockchainRPCCommands (CRPCTable &t)
 Register block chain RPC commands. More...
 

Function Documentation

◆ blockheaderToJSON()

UniValue blockheaderToJSON ( const CBlockIndex blockindex)

Block header to JSON.

Definition at line 88 of file blockchain.cpp.

Here is the call graph for this function:

◆ blockToJSON()

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

Block description to JSON.

Definition at line 118 of file blockchain.cpp.

Here is the call graph for this function:

◆ CalculatePercentilesByWeight()

void CalculatePercentilesByWeight ( CAmount  result[NUM_GETBLOCKSTATS_PERCENTILES],
std::vector< std::pair< CAmount, int64_t >> &  scores,
int64_t  total_weight 
)

Used by getblockstats to get feerates at different percentiles by weight.

Definition at line 1662 of file blockchain.cpp.

◆ FindScriptPubKey()

bool FindScriptPubKey ( std::atomic< int > &  scan_progress,
const std::atomic< bool > &  should_abort,
int64_t &  count,
CCoinsViewCursor cursor,
const std::set< CScript > &  needles,
std::map< COutPoint, Coin > &  out_results 
)

Search for a given set of pubkey scripts.

Definition at line 1990 of file blockchain.cpp.

◆ getblockchaininfo()

UniValue getblockchaininfo ( const JSONRPCRequest request)

Implementation of IsSuperMajority with better feedback.

Definition at line 1201 of file blockchain.cpp.

Here is the call graph for this function:

◆ GetDifficulty()

double GetDifficulty ( const CBlockIndex blockindex)

Get the difficulty of the net wrt to the given block index.

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

Definition at line 60 of file blockchain.cpp.

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

◆ gettxout()

UniValue gettxout ( const JSONRPCRequest request)

Definition at line 1018 of file blockchain.cpp.

Here is the call graph for this function:

◆ mempoolInfoToJSON()

UniValue mempoolInfoToJSON ( )

Mempool information to JSON.

Definition at line 1423 of file blockchain.cpp.

Here is the call graph for this function:

◆ mempoolToJSON()

UniValue mempoolToJSON ( bool  fVerbose)

Mempool to JSON.

Definition at line 451 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 2238 of file blockchain.cpp.

◆ RPCNotifyBlockChange()

void RPCNotifyBlockChange ( bool  ibd,
const CBlockIndex  
)

Callback for when block tip changed.

Definition at line 198 of file blockchain.cpp.

◆ scantxoutset()

UniValue scantxoutset ( const JSONRPCRequest request)

Definition at line 2049 of file blockchain.cpp.

Here is the call graph for this function: