![]() |
Bitcoin Core 22.99.0
P2P Digital Currency
|
#include <consensus/amount.h>
#include <core_io.h>
#include <streams.h>
#include <sync.h>
#include <any>
#include <stdint.h>
#include <vector>
Go to the source code of this file.
Functions | |
double | GetDifficulty (const CBlockIndex *blockindex) |
Get the difficulty of the net wrt to the given block index. More... | |
void | RPCNotifyBlockChange (const CBlockIndex *) |
Callback for when block tip changed. More... | |
UniValue | blockToJSON (const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, TxVerbosity verbosity) LOCKS_EXCLUDED(cs_main) |
Block description to JSON. More... | |
UniValue | MempoolInfoToJSON (const CTxMemPool &pool) |
Mempool information to JSON. More... | |
UniValue | MempoolToJSON (const CTxMemPool &pool, bool verbose=false, bool include_mempool_sequence=false) |
Mempool to JSON. More... | |
UniValue | blockheaderToJSON (const CBlockIndex *tip, const CBlockIndex *blockindex) LOCKS_EXCLUDED(cs_main) |
Block header 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... | |
NodeContext & | EnsureAnyNodeContext (const std::any &context) |
CTxMemPool & | EnsureMemPool (const NodeContext &node) |
CTxMemPool & | EnsureAnyMemPool (const std::any &context) |
ChainstateManager & | EnsureChainman (const NodeContext &node) |
ChainstateManager & | EnsureAnyChainman (const std::any &context) |
CBlockPolicyEstimator & | EnsureFeeEstimator (const NodeContext &node) |
CBlockPolicyEstimator & | EnsureAnyFeeEstimator (const std::any &context) |
UniValue | CreateUTXOSnapshot (NodeContext &node, CChainState &chainstate, CAutoFile &afile) |
Helper to create UTXO snapshots given a chainstate and a file handle. More... | |
Variables | |
RecursiveMutex | cs_main |
Mutex to guard access to validation specific variables, such as reading or changing the chainstate. More... | |
static constexpr int | NUM_GETBLOCKSTATS_PERCENTILES = 5 |
UniValue blockheaderToJSON | ( | const CBlockIndex * | tip, |
const CBlockIndex * | blockindex | ||
) |
Block header to JSON.
Definition at line 174 of file blockchain.cpp.
UniValue blockToJSON | ( | const CBlock & | block, |
const CBlockIndex * | tip, | ||
const CBlockIndex * | blockindex, | ||
TxVerbosity | verbosity | ||
) |
Block description to JSON.
Definition at line 203 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 1921 of file blockchain.cpp.
UniValue CreateUTXOSnapshot | ( | NodeContext & | node, |
CChainState & | chainstate, | ||
CAutoFile & | afile | ||
) |
Helper to create UTXO snapshots given a chainstate and a file handle.
Definition at line 2581 of file blockchain.cpp.
ChainstateManager & EnsureAnyChainman | ( | const std::any & | context | ) |
Definition at line 95 of file blockchain.cpp.
CBlockPolicyEstimator & EnsureAnyFeeEstimator | ( | const std::any & | context | ) |
Definition at line 108 of file blockchain.cpp.
CTxMemPool & EnsureAnyMemPool | ( | const std::any & | context | ) |
Definition at line 82 of file blockchain.cpp.
NodeContext & EnsureAnyNodeContext | ( | const std::any & | context | ) |
Definition at line 65 of file blockchain.cpp.
ChainstateManager & EnsureChainman | ( | const NodeContext & | node | ) |
Definition at line 87 of file blockchain.cpp.
CBlockPolicyEstimator & EnsureFeeEstimator | ( | const NodeContext & | node | ) |
Definition at line 100 of file blockchain.cpp.
CTxMemPool & EnsureMemPool | ( | const NodeContext & | node | ) |
Definition at line 74 of file blockchain.cpp.
double GetDifficulty | ( | const CBlockIndex * | blockindex | ) |
Get the difficulty of the net wrt to the given block index.
Definition at line 115 of file blockchain.cpp.
UniValue MempoolInfoToJSON | ( | const CTxMemPool & | pool | ) |
Mempool information to JSON.
Definition at line 1657 of file blockchain.cpp.
UniValue MempoolToJSON | ( | const CTxMemPool & | pool, |
bool | verbose = false , |
||
bool | include_mempool_sequence = false |
||
) |
Mempool to JSON.
Definition at line 553 of file blockchain.cpp.
void RPCNotifyBlockChange | ( | const CBlockIndex * | pindex | ) |
Callback for when block tip changed.
Definition at line 280 of file blockchain.cpp.
|
extern |
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
This may also need to be locked when updating the transaction pool, e.g. on AcceptToMemoryPool. See CTxMemPool::cs comment for details.
The transaction pool has a separate lock to allow reading from it and the chainstate at the same time.
Definition at line 118 of file validation.cpp.
|
staticconstexpr |
Definition at line 28 of file blockchain.h.