![]() |
Bitcoin ABC
0.22.13
P2P Digital Currency
|
#include <rpc/blockchain.h>
#include <amount.h>
#include <blockdb.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <checkpoints.h>
#include <coins.h>
#include <config.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <hash.h>
#include <index/blockfilterindex.h>
#include <network.h>
#include <node/coinstats.h>
#include <node/context.h>
#include <node/utxo_snapshot.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <streams.h>
#include <txdb.h>
#include <txmempool.h>
#include <undo.h>
#include <util/ref.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <validation.h>
#include <validationinterface.h>
#include <versionbitsinfo.h>
#include <warnings.h>
#include <condition_variable>
#include <cstdint>
#include <memory>
#include <mutex>
Go to the source code of this file.
Classes | |
struct | CUpdatedBlock |
struct | CompareBlocksByHeight |
Comparison function for sorting the getchaintips heads. More... | |
class | CoinsViewScanReserver |
Functions | |
static CUpdatedBlock latestblock | GUARDED_BY (cs_blockchange) |
NodeContext & | EnsureNodeContext (const util::Ref &context) |
CTxMemPool & | EnsureMemPool (const util::Ref &context) |
ChainstateManager & | EnsureChainman (const util::Ref &context) |
double | GetDifficulty (const CBlockIndex *blockindex) |
Calculate the difficulty for a given block index. More... | |
static int | ComputeNextBlockAndDepth (const CBlockIndex *tip, const CBlockIndex *blockindex, const CBlockIndex *&next) |
UniValue | blockheaderToJSON (const CBlockIndex *tip, const CBlockIndex *blockindex) |
Block header to JSON. More... | |
UniValue | blockToJSON (const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails) |
Block description to JSON. More... | |
static UniValue | getblockcount (const Config &config, const JSONRPCRequest &request) |
static UniValue | getbestblockhash (const Config &config, const JSONRPCRequest &request) |
UniValue | getfinalizedblockhash (const Config &config, const JSONRPCRequest &request) |
void | RPCNotifyBlockChange (const CBlockIndex *pindex) |
Callback for when block tip changed. More... | |
static UniValue | waitfornewblock (const Config &config, const JSONRPCRequest &request) |
static UniValue | waitforblock (const Config &config, const JSONRPCRequest &request) |
static UniValue | waitforblockheight (const Config &config, const JSONRPCRequest &request) |
static UniValue | syncwithvalidationinterfacequeue (const Config &config, const JSONRPCRequest &request) |
static UniValue | getdifficulty (const Config &config, const JSONRPCRequest &request) |
static std::vector< RPCResult > | MempoolEntryDescription () |
static void | entryToJSON (const CTxMemPool &pool, UniValue &info, const CTxMemPoolEntry &e) EXCLUSIVE_LOCKS_REQUIRED(pool.cs) |
UniValue | MempoolToJSON (const CTxMemPool &pool, bool verbose) |
Mempool to JSON. More... | |
static UniValue | getrawmempool (const Config &config, const JSONRPCRequest &request) |
static UniValue | getmempoolancestors (const Config &config, const JSONRPCRequest &request) |
static UniValue | getmempooldescendants (const Config &config, const JSONRPCRequest &request) |
static UniValue | getmempoolentry (const Config &config, const JSONRPCRequest &request) |
static UniValue | getblockhash (const Config &config, const JSONRPCRequest &request) |
static UniValue | getblockheader (const Config &config, const JSONRPCRequest &request) |
static CBlock | GetBlockChecked (const Config &config, const CBlockIndex *pblockindex) |
static CBlockUndo | GetUndoChecked (const CBlockIndex *pblockindex) |
static UniValue | getblock (const Config &config, const JSONRPCRequest &request) |
static UniValue | pruneblockchain (const Config &config, const JSONRPCRequest &request) |
static UniValue | gettxoutsetinfo (const Config &config, const JSONRPCRequest &request) |
UniValue | gettxout (const Config &config, const JSONRPCRequest &request) |
static UniValue | verifychain (const Config &config, const JSONRPCRequest &request) |
static void | BIP9SoftForkDescPushBack (UniValue &softforks, const Consensus::Params &consensusParams, Consensus::DeploymentPos id) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
UniValue | getblockchaininfo (const Config &config, const JSONRPCRequest &request) |
static UniValue | getchaintips (const Config &config, const JSONRPCRequest &request) |
UniValue | MempoolInfoToJSON (const CTxMemPool &pool) |
Mempool information to JSON. More... | |
static UniValue | getmempoolinfo (const Config &config, const JSONRPCRequest &request) |
static UniValue | preciousblock (const Config &config, const JSONRPCRequest &request) |
UniValue | finalizeblock (const Config &config, const JSONRPCRequest &request) |
static UniValue | invalidateblock (const Config &config, const JSONRPCRequest &request) |
UniValue | parkblock (const Config &config, const JSONRPCRequest &request) |
static UniValue | reconsiderblock (const Config &config, const JSONRPCRequest &request) |
UniValue | unparkblock (const Config &config, const JSONRPCRequest &request) |
static UniValue | getchaintxstats (const Config &config, const JSONRPCRequest &request) |
template<typename T > | |
static T | CalculateTruncatedMedian (std::vector< T > &scores) |
template<typename T > | |
static bool | SetHasKeys (const std::set< T > &set) |
template<typename T , typename Tk , typename... Args> | |
static bool | SetHasKeys (const std::set< T > &set, const Tk &key, const Args &... args) |
static UniValue | getblockstats (const Config &config, const JSONRPCRequest &request) |
static UniValue | savemempool (const Config &config, const JSONRPCRequest &request) |
static UniValue | scantxoutset (const Config &config, const JSONRPCRequest &request) |
static UniValue | getblockfilter (const Config &config, const JSONRPCRequest &request) |
static UniValue | dumptxoutset (const Config &config, const JSONRPCRequest &request) |
Serialize the UTXO set to a file for loading elsewhere. More... | |
void | RegisterBlockchainRPCCommands (CRPCTable &t) |
Register block chain RPC commands. More... | |
Variables | |
static Mutex | cs_blockchange |
static std::condition_variable | cond_blockchange |
static constexpr size_t | PER_UTXO_OVERHEAD |
static std::atomic< int > | g_scan_progress |
RAII object to prevent concurrency issue when scanning the txout set. More... | |
static std::atomic< bool > | g_scan_in_progress |
static std::atomic< bool > | g_should_abort_scan |
|
static |
Definition at line 1357 of file blockchain.cpp.
UniValue blockheaderToJSON | ( | const CBlockIndex * | tip, |
const CBlockIndex * | blockindex | ||
) |
Block header to JSON.
Definition at line 111 of file blockchain.cpp.
UniValue blockToJSON | ( | const CBlock & | block, |
const CBlockIndex * | tip, | ||
const CBlockIndex * | blockindex, | ||
bool | txDetails | ||
) |
Block description to JSON.
Definition at line 145 of file blockchain.cpp.
|
static |
|
static |
Definition at line 100 of file blockchain.cpp.
|
static |
Serialize the UTXO set to a file for loading elsewhere.
Definition at line 2829 of file blockchain.cpp.
ChainstateManager& EnsureChainman | ( | const util::Ref & | context | ) |
Definition at line 71 of file blockchain.cpp.
CTxMemPool& EnsureMemPool | ( | const util::Ref & | context | ) |
Definition at line 62 of file blockchain.cpp.
NodeContext& EnsureNodeContext | ( | const util::Ref & | context | ) |
Definition at line 55 of file blockchain.cpp.
|
static |
Definition at line 532 of file blockchain.cpp.
UniValue finalizeblock | ( | const Config & | config, |
const JSONRPCRequest & | request | ||
) |
Definition at line 1813 of file blockchain.cpp.
|
static |
Definition at line 208 of file blockchain.cpp.
|
static |
Definition at line 975 of file blockchain.cpp.
UniValue getblockchaininfo | ( | const Config & | config, |
const JSONRPCRequest & | request | ||
) |
Definition at line 1419 of file blockchain.cpp.
|
static |
Definition at line 942 of file blockchain.cpp.
|
static |
Definition at line 191 of file blockchain.cpp.
|
static |
Definition at line 2735 of file blockchain.cpp.
|
static |
Definition at line 825 of file blockchain.cpp.
|
static |
Definition at line 851 of file blockchain.cpp.
|
static |
Definition at line 2146 of file blockchain.cpp.
|
static |
Idea: the set of chain tips is ChainActive().tip, plus orphan blocks which do not have another orphan building off of them. Algorithm:
Definition at line 1596 of file blockchain.cpp.
|
static |
Definition at line 2014 of file blockchain.cpp.
double GetDifficulty | ( | const CBlockIndex * | blockindex | ) |
Calculate the difficulty for a given block index.
Get the required difficulty of the next block w/r/t the given block index.
Definition at line 82 of file blockchain.cpp.
|
static |
Definition at line 445 of file blockchain.cpp.
UniValue getfinalizedblockhash | ( | const Config & | config, |
const JSONRPCRequest & | request | ||
) |
Definition at line 225 of file blockchain.cpp.
|
static |
Definition at line 650 of file blockchain.cpp.
|
static |
Definition at line 719 of file blockchain.cpp.
|
static |
Definition at line 793 of file blockchain.cpp.
|
static |
Definition at line 1736 of file blockchain.cpp.
|
static |
Definition at line 608 of file blockchain.cpp.
UniValue gettxout | ( | const Config & | config, |
const JSONRPCRequest & | request | ||
) |
Definition at line 1232 of file blockchain.cpp.
|
static |
Definition at line 1176 of file blockchain.cpp.
|
static |
Definition at line 961 of file blockchain.cpp.
|
static |
|
static |
Definition at line 1856 of file blockchain.cpp.
|
static |
UniValue MempoolInfoToJSON | ( | const CTxMemPool & | pool | ) |
Mempool information to JSON.
Definition at line 1716 of file blockchain.cpp.
UniValue MempoolToJSON | ( | const CTxMemPool & | pool, |
bool | verbose | ||
) |
Mempool to JSON.
Definition at line 581 of file blockchain.cpp.
UniValue parkblock | ( | const Config & | config, |
const JSONRPCRequest & | request | ||
) |
Definition at line 1896 of file blockchain.cpp.
|
static |
Definition at line 1773 of file blockchain.cpp.
|
static |
Definition at line 1104 of file blockchain.cpp.
|
static |
Definition at line 1935 of file blockchain.cpp.
void RegisterBlockchainRPCCommands | ( | CRPCTable & | t | ) |
Register block chain RPC commands.
Definition at line 2939 of file blockchain.cpp.
void RPCNotifyBlockChange | ( | const CBlockIndex * | pindex | ) |
Callback for when block tip changed.
Definition at line 246 of file blockchain.cpp.
|
static |
Definition at line 2433 of file blockchain.cpp.
|
static |
Definition at line 2525 of file blockchain.cpp.
|
inlinestatic |
|
inlinestatic |
|
static |
Definition at line 428 of file blockchain.cpp.
UniValue unparkblock | ( | const Config & | config, |
const JSONRPCRequest & | request | ||
) |
Definition at line 1974 of file blockchain.cpp.
|
static |
Definition at line 1325 of file blockchain.cpp.
|
static |
Definition at line 309 of file blockchain.cpp.
|
static |
Definition at line 370 of file blockchain.cpp.
|
static |
Definition at line 255 of file blockchain.cpp.
|
static |
Definition at line 52 of file blockchain.cpp.
|
static |
Definition at line 51 of file blockchain.cpp.
|
static |
Definition at line 2500 of file blockchain.cpp.
|
static |
RAII object to prevent concurrency issue when scanning the txout set.
Definition at line 2499 of file blockchain.cpp.
|
static |
Definition at line 2501 of file blockchain.cpp.
|
static |
Definition at line 2143 of file blockchain.cpp.