![]() |
Bitcoin Core
0.21.1
P2P Digital Currency
|
#include <rpc/blockchain.h>#include <amount.h>#include <blockfilter.h>#include <chain.h>#include <chainparams.h>#include <coins.h>#include <consensus/validation.h>#include <core_io.h>#include <hash.h>#include <index/blockfilterindex.h>#include <node/coinstats.h>#include <node/context.h>#include <node/utxo_snapshot.h>#include <policy/feerate.h>#include <policy/policy.h>#include <policy/rbf.h>#include <primitives/transaction.h>#include <rpc/server.h>#include <rpc/util.h>#include <script/descriptor.h>#include <streams.h>#include <sync.h>#include <txdb.h>#include <txmempool.h>#include <undo.h>#include <util/ref.h>#include <util/strencodings.h>#include <util/system.h>#include <util/translation.h>#include <validation.h>#include <validationinterface.h>#include <warnings.h>#include <stdint.h>#include <univalue.h>#include <condition_variable>#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) |
| Get the difficulty of the net wrt to the 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 RPCHelpMan | getblockcount () |
| static RPCHelpMan | getbestblockhash () |
| void | RPCNotifyBlockChange (const CBlockIndex *pindex) |
| Callback for when block tip changed. More... | |
| static RPCHelpMan | waitfornewblock () |
| static RPCHelpMan | waitforblock () |
| static RPCHelpMan | waitforblockheight () |
| static RPCHelpMan | syncwithvalidationinterfacequeue () |
| static RPCHelpMan | getdifficulty () |
| 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, bool include_mempool_sequence) |
| Mempool to JSON. More... | |
| static RPCHelpMan | getrawmempool () |
| static RPCHelpMan | getmempoolancestors () |
| static RPCHelpMan | getmempooldescendants () |
| static RPCHelpMan | getmempoolentry () |
| static RPCHelpMan | getblockhash () |
| static RPCHelpMan | getblockheader () |
| static CBlock | GetBlockChecked (const CBlockIndex *pblockindex) |
| static CBlockUndo | GetUndoChecked (const CBlockIndex *pblockindex) |
| static RPCHelpMan | getblock () |
| static RPCHelpMan | pruneblockchain () |
| static RPCHelpMan | gettxoutsetinfo () |
| static RPCHelpMan | gettxout () |
| static RPCHelpMan | verifychain () |
| static void | BuriedForkDescPushBack (UniValue &softforks, const std::string &name, int height) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| static void | BIP9SoftForkDescPushBack (UniValue &softforks, const std::string &name, const Consensus::Params &consensusParams, Consensus::DeploymentPos id) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
| RPCHelpMan | getblockchaininfo () |
| static RPCHelpMan | getchaintips () |
| UniValue | MempoolInfoToJSON (const CTxMemPool &pool) |
| Mempool information to JSON. More... | |
| static RPCHelpMan | getmempoolinfo () |
| static RPCHelpMan | preciousblock () |
| static RPCHelpMan | invalidateblock () |
| static RPCHelpMan | reconsiderblock () |
| static RPCHelpMan | getchaintxstats () |
| template<typename T > | |
| static T | CalculateTruncatedMedian (std::vector< T > &scores) |
| 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... | |
| 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 RPCHelpMan | getblockstats () |
| static RPCHelpMan | savemempool () |
| static RPCHelpMan | scantxoutset () |
| static RPCHelpMan | getblockfilter () |
| static RPCHelpMan | dumptxoutset () |
| 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 = sizeof(COutPoint) + sizeof(uint32_t) + sizeof(bool) |
| 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 1214 of file blockchain.cpp.
| UniValue blockheaderToJSON | ( | const CBlockIndex * | tip, |
| const CBlockIndex * | blockindex | ||
| ) |
Block header to JSON.
Definition at line 118 of file blockchain.cpp.
| UniValue blockToJSON | ( | const CBlock & | block, |
| const CBlockIndex * | tip, | ||
| const CBlockIndex * | blockindex, | ||
| bool | txDetails | ||
| ) |
Block description to JSON.
Definition at line 147 of file blockchain.cpp.
|
static |
Definition at line 1196 of file blockchain.cpp.
| 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 1736 of file blockchain.cpp.
|
static |
|
static |
Definition at line 108 of file blockchain.cpp.
|
static |
Serialize the UTXO set to a file for loading elsewhere.
Definition at line 2360 of file blockchain.cpp.
| ChainstateManager& EnsureChainman | ( | const util::Ref & | context | ) |
Definition at line 75 of file blockchain.cpp.
| CTxMemPool& EnsureMemPool | ( | const util::Ref & | context | ) |
Definition at line 66 of file blockchain.cpp.
| NodeContext& EnsureNodeContext | ( | const util::Ref & | context | ) |
Definition at line 58 of file blockchain.cpp.
|
static |
Definition at line 441 of file blockchain.cpp.
|
static |
Definition at line 212 of file blockchain.cpp.
|
static |
Definition at line 883 of file blockchain.cpp.
| RPCHelpMan getblockchaininfo | ( | ) |
Definition at line 1261 of file blockchain.cpp.
|
static |
Definition at line 852 of file blockchain.cpp.
|
static |
Definition at line 192 of file blockchain.cpp.
|
static |
Definition at line 2277 of file blockchain.cpp.
|
static |
Definition at line 756 of file blockchain.cpp.
|
static |
Definition at line 783 of file blockchain.cpp.
|
static |
Definition at line 1776 of file blockchain.cpp.
|
static |
Definition at line 1381 of file blockchain.cpp.
|
static |
Definition at line 1641 of file blockchain.cpp.
| double GetDifficulty | ( | const CBlockIndex * | blockindex | ) |
Get the difficulty of the net wrt to the given block index.
Definition at line 86 of file blockchain.cpp.
|
static |
Definition at line 393 of file blockchain.cpp.
|
static |
Definition at line 594 of file blockchain.cpp.
|
static |
Definition at line 658 of file blockchain.cpp.
|
static |
Definition at line 723 of file blockchain.cpp.
|
static |
Definition at line 1495 of file blockchain.cpp.
|
static |
Definition at line 544 of file blockchain.cpp.
|
static |
Definition at line 1088 of file blockchain.cpp.
|
static |
Definition at line 1034 of file blockchain.cpp.
|
static |
Definition at line 869 of file blockchain.cpp.
|
static |
|
static |
Definition at line 1562 of file blockchain.cpp.
|
static |
| UniValue MempoolInfoToJSON | ( | const CTxMemPool & | pool | ) |
Mempool information to JSON.
Definition at line 1478 of file blockchain.cpp.
| UniValue MempoolToJSON | ( | const CTxMemPool & | pool, |
| bool | verbose, | ||
| bool | include_mempool_sequence | ||
| ) |
Mempool to JSON.
Definition at line 503 of file blockchain.cpp.
|
static |
Definition at line 1523 of file blockchain.cpp.
|
static |
Definition at line 977 of file blockchain.cpp.
|
static |
Definition at line 1602 of file blockchain.cpp.
| void RegisterBlockchainRPCCommands | ( | CRPCTable & | t | ) |
Register block chain RPC commands.
Definition at line 2463 of file blockchain.cpp.
| void RPCNotifyBlockChange | ( | const CBlockIndex * | ) |
Callback for when block tip changed.
Definition at line 231 of file blockchain.cpp.
|
static |
Definition at line 2037 of file blockchain.cpp.
|
static |
Definition at line 2123 of file blockchain.cpp.
|
inlinestatic |
|
inlinestatic |
|
static |
Definition at line 375 of file blockchain.cpp.
|
static |
Definition at line 1169 of file blockchain.cpp.
|
static |
Definition at line 283 of file blockchain.cpp.
|
static |
Definition at line 329 of file blockchain.cpp.
|
static |
Definition at line 241 of file blockchain.cpp.
|
static |
Definition at line 55 of file blockchain.cpp.
|
static |
Definition at line 54 of file blockchain.cpp.
|
static |
Definition at line 2098 of file blockchain.cpp.
|
static |
RAII object to prevent concurrency issue when scanning the txout set.
Definition at line 2097 of file blockchain.cpp.
|
static |
Definition at line 2099 of file blockchain.cpp.
|
static |
Definition at line 1774 of file blockchain.cpp.
1.8.8