5 #ifndef BITCOIN_RPC_BLOCKCHAIN_H 6 #define BITCOIN_RPC_BLOCKCHAIN_H 13 #include <validation.h> 64 #endif // BITCOIN_RPC_BLOCKCHAIN_H static constexpr int NUM_GETBLOCKSTATS_PERCENTILES
double GetDifficulty(const CBlockIndex &blockindex)
Get the difficulty of the net wrt to the given block index.
UniValue CreateUTXOSnapshot(node::NodeContext &node, Chainstate &chainstate, AutoFile &afile, const fs::path &path, const fs::path &tmppath)
Helper to create UTXO snapshots given a chainstate and a file handle.
TxVerbosity
Verbose level for block's transaction.
An in-memory indexed chain of blocks.
Non-refcounted RAII wrapper for FILE*.
int64_t CAmount
Amount in satoshis (Can be negative)
NodeContext struct containing references to chain state and connection state.
void RPCNotifyBlockChange(const CBlockIndex *)
Callback for when block tip changed.
Chainstate stores and provides an API to update our local knowledge of the current best chain...
UniValue blockToJSON(node::BlockManager &blockman, const CBlock &block, const CBlockIndex &tip, const CBlockIndex &blockindex, TxVerbosity verbosity) LOCKS_EXCLUDED(cs_main)
Block description to JSON.
UniValue blockheaderToJSON(const CBlockIndex &tip, const CBlockIndex &blockindex) LOCKS_EXCLUDED(cs_main)
Block header to JSON.
Maintains a tree of blocks (stored in m_block_index) which is consulted to determine where the most-w...
std::optional< int > GetPruneHeight(const BlockManager &blockman, const CChain &chain)
Return height of highest block that has been pruned, or std::nullopt if no blocks have been pruned...
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.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
#define LOCKS_EXCLUDED(...)
The block chain is a tree shaped structure starting with the genesis block at the root...
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...