5#ifndef BITCOIN_RPC_BLOCKCHAIN_H
6#define BITCOIN_RPC_BLOCKCHAIN_H
int64_t CAmount
Amount in satoshis (Can be negative)
ChainstateManager & EnsureAnyChainman(const std::any &context)
CBlockPolicyEstimator & EnsureFeeEstimator(const NodeContext &node)
UniValue blockToJSON(const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, TxVerbosity verbosity) LOCKS_EXCLUDED(cs_main)
Block description to JSON.
void RPCNotifyBlockChange(const CBlockIndex *)
Callback for when block tip changed.
static constexpr int NUM_GETBLOCKSTATS_PERCENTILES
double GetDifficulty(const CBlockIndex *blockindex)
Get the difficulty of the net wrt to the given block index.
NodeContext & EnsureAnyNodeContext(const std::any &context)
CTxMemPool & EnsureMemPool(const NodeContext &node)
ChainstateManager & EnsureChainman(const NodeContext &node)
UniValue MempoolInfoToJSON(const CTxMemPool &pool)
Mempool information to JSON.
CTxMemPool & EnsureAnyMemPool(const std::any &context)
CBlockPolicyEstimator & EnsureAnyFeeEstimator(const std::any &context)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
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
UniValue MempoolToJSON(const CTxMemPool &pool, bool verbose=false, bool include_mempool_sequence=false)
Mempool to JSON.
UniValue blockheaderToJSON(const CBlockIndex *tip, const CBlockIndex *blockindex) LOCKS_EXCLUDED(cs_main)
Block header to JSON.
UniValue CreateUTXOSnapshot(NodeContext &node, CChainState &chainstate, CAutoFile &afile)
Helper to create UTXO snapshots given a chainstate and a file handle.
Non-refcounted RAII wrapper for FILE*.
The block chain is a tree shaped structure starting with the genesis block at the root,...
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
CChainState stores and provides an API to update our local knowledge of the current best chain.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
TxVerbosity
Verbose level for block's transaction.
NodeContext struct containing references to chain state and connection state.
#define LOCKS_EXCLUDED(...)