Fabcoin Core  0.16.2
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 <consensus/params.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 <streams.h>
#include <sync.h>
#include <txdb.h>
#include <txmempool.h>
#include <util.h>
#include <utilstrencodings.h>
#include <hash.h>
#include <libdevcore/CommonData.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

class  WaitForLogsParams
 
class  SearchLogsParams
 
struct  CCoinsStats
 
struct  CompareBlocksByHeight
 Comparison function for sorting the getchaintips heads. More...
 

Functions

void TxToJSON (const CTransaction &tx, const uint256 hashBlock, UniValue &entry)
 
void ScriptPubKeyToJSON (const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
 
double GetDifficultyINTERNAL (const CBlockIndex *blockindex)
 
double GetDifficultyBitcoin (const CBlockIndex *blockindex)
 
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 blockToJSON (const CBlock &block, const CBlockIndex *blockindex, bool txDetails)
 Block description to JSON. More...
 
UniValue executionResultToJSON (const dev::eth::ExecutionResult &exRes)
 
UniValue transactionReceiptToJSON (const dev::eth::TransactionReceipt &txRec)
 
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 getblockhash (const JSONRPCRequest &request)
 
UniValue getaccountinfo (const JSONRPCRequest &request)
 
UniValue getstorage (const JSONRPCRequest &request)
 
UniValue getblockheader (const JSONRPCRequest &request)
 
UniValue getblock (const JSONRPCRequest &request)
 
UniValue callcontract (const JSONRPCRequest &request)
 
void assignJSON (UniValue &entry, const TransactionReceiptInfo &resExec)
 
void assignJSON (UniValue &logEntry, const dev::eth::LogEntry &log, bool includeAddress)
 
void transactionReceiptInfoToJSON (const TransactionReceiptInfo &resExec, UniValue &entry)
 
size_t parseUInt (const UniValue &val, size_t defaultVal)
 
int parseBlockHeight (const UniValue &val)
 
int parseBlockHeight (const UniValue &val, int defaultVal)
 
dev::h160 parseParamH160 (const UniValue &val)
 
void parseParam (const UniValue &val, std::vector< dev::h160 > &h160s)
 
void parseParam (const UniValue &val, std::set< dev::h160 > &h160s)
 
void parseParam (const UniValue &val, std::vector< boost::optional< dev::h256 >> &h256s)
 
UniValue waitforlogs (const JSONRPCRequest &request_)
 
UniValue searchlogs (const JSONRPCRequest &request)
 
UniValue gettransactionreceipt (const JSONRPCRequest &request)
 
UniValue listcontracts (const JSONRPCRequest &request)
 
UniValue pruneblockchain (const JSONRPCRequest &request)
 
UniValue gettxoutsetinfo (const JSONRPCRequest &request)
 
UniValue gettxoutset (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)
 
void RegisterBlockchainRPCCommands (CRPCTable &t)
 Register block chain RPC commands. More...
 

Detailed Description

Author
Christoph Jentzsch cj@et.nosp@m.hdev.nosp@m..com, Dimitry Khokhlov dimit.nosp@m.ry@e.nosp@m.thdev.nosp@m..com
Date
2015 BlockChain test functions.

Definition in file blockchain.cpp.

Function Documentation

void assignJSON ( UniValue entry,
const TransactionReceiptInfo resExec 
)

Definition at line 1085 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void assignJSON ( UniValue logEntry,
const dev::eth::LogEntry log,
bool  includeAddress 
)

Definition at line 1102 of file blockchain.cpp.

Here is the call graph for this function:

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

Definition at line 2042 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue blockheaderToJSON ( const CBlockIndex blockindex)

Block header to JSON.

!!

!!

Definition at line 125 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Block description to JSON.

!!

!!

Definition at line 175 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue callcontract ( const JSONRPCRequest request)

Definition at line 1028 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string EntryDescriptionString ( )

Definition at line 457 of file blockchain.cpp.

Here is the caller graph for this function:

void entryToJSON ( UniValue info,
const CTxMemPoolEntry e 
)

Definition at line 475 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue executionResultToJSON ( const dev::eth::ExecutionResult exRes)

Definition at line 234 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getaccountinfo ( const JSONRPCRequest request)

Definition at line 753 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getbestblockhash ( const JSONRPCRequest request)

Definition at line 291 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getblock ( const JSONRPCRequest request)

Definition at line 933 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getblockchaininfo ( const JSONRPCRequest request)

Definition at line 2051 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getblockcount ( const JSONRPCRequest request)

Definition at line 274 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getblockhash ( const JSONRPCRequest request)

Definition at line 728 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getblockheader ( const JSONRPCRequest request)

Definition at line 871 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getchaintips ( const JSONRPCRequest request)

Definition at line 2151 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getchaintxstats ( const JSONRPCRequest request)

Definition at line 2402 of file blockchain.cpp.

Here is the call graph for this function:

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 105 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getdifficulty ( const JSONRPCRequest request)

Definition at line 440 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

double GetDifficultyBitcoin ( const CBlockIndex blockindex)

Definition at line 84 of file blockchain.cpp.

Here is the caller graph for this function:

double GetDifficultyINTERNAL ( const CBlockIndex blockindex)

Definition at line 46 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getmempoolancestors ( const JSONRPCRequest request)

Definition at line 567 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getmempooldescendants ( const JSONRPCRequest request)

Definition at line 631 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getmempoolentry ( const JSONRPCRequest request)

Definition at line 695 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getmempoolinfo ( const JSONRPCRequest request)

Definition at line 2267 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getrawmempool ( const JSONRPCRequest request)

Definition at line 535 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue getstorage ( const JSONRPCRequest request)

Definition at line 803 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue gettransactionreceipt ( const JSONRPCRequest request)

Definition at line 1556 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue gettxout ( const JSONRPCRequest request)

Definition at line 1872 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue gettxoutset ( const JSONRPCRequest request)

Definition at line 1802 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue gettxoutsetinfo ( const JSONRPCRequest request)

Definition at line 1759 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue invalidateblock ( const JSONRPCRequest request)

Definition at line 2327 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue listcontracts ( const JSONRPCRequest request)

Definition at line 1590 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue mempoolInfoToJSON ( )

Mempool information to JSON.

Definition at line 2254 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue mempoolToJSON ( bool  fVerbose)

Mempool to JSON.

Definition at line 507 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int parseBlockHeight ( const UniValue val)

Definition at line 1142 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int parseBlockHeight ( const UniValue val,
int  defaultVal 
)

Definition at line 1166 of file blockchain.cpp.

Here is the call graph for this function:

void parseParam ( const UniValue val,
std::vector< dev::h160 > &  h160s 
)

Definition at line 1187 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void parseParam ( const UniValue val,
std::set< dev::h160 > &  h160s 
)

Definition at line 1210 of file blockchain.cpp.

Here is the call graph for this function:

void parseParam ( const UniValue val,
std::vector< boost::optional< dev::h256 >> &  h256s 
)

Definition at line 1216 of file blockchain.cpp.

Here is the call graph for this function:

dev::h160 parseParamH160 ( const UniValue val)

Definition at line 1174 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

size_t parseUInt ( const UniValue val,
size_t  defaultVal 
)

Definition at line 1129 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue preciousblock ( const JSONRPCRequest request)

Definition at line 2289 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue pruneblockchain ( const JSONRPCRequest request)

Definition at line 1710 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue reconsiderblock ( const JSONRPCRequest request)

Definition at line 2365 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RegisterBlockchainRPCCommands ( CRPCTable t)

Register block chain RPC commands.

Definition at line 2507 of file blockchain.cpp.

Here is the call graph for this function:

void RPCNotifyBlockChange ( bool  ibd,
const CBlockIndex  
)

Callback for when block tip changed.

Definition at line 308 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ScriptPubKeyToJSON ( const CScript scriptPubKey,
UniValue out,
bool  fIncludeHex 
)
UniValue searchlogs ( const JSONRPCRequest request)

Definition at line 1467 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void transactionReceiptInfoToJSON ( const TransactionReceiptInfo resExec,
UniValue entry 
)

Definition at line 1116 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue transactionReceiptToJSON ( const dev::eth::TransactionReceipt txRec)

Definition at line 250 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 38 of file rawtransaction.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue verifychain ( const JSONRPCRequest request)

Definition at line 1952 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue waitforblock ( const JSONRPCRequest request)

Definition at line 356 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue waitforblockheight ( const JSONRPCRequest request)

Definition at line 398 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue waitforlogs ( const JSONRPCRequest request_)

Definition at line 1280 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue waitfornewblock ( const JSONRPCRequest request)

Definition at line 318 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: