5 #ifndef BITCOIN_RPC_BLOCKCHAIN_H 6 #define BITCOIN_RPC_BLOCKCHAIN_H static constexpr int NUM_GETBLOCKSTATS_PERCENTILES
UniValue MempoolInfoToJSON(const CTxMemPool &pool)
Mempool information to JSON.
CBlockPolicyEstimator & EnsureFeeEstimator(const util::Ref &context)
ChainstateManager & EnsureChainman(const util::Ref &context)
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
UniValue MempoolToJSON(const CTxMemPool &pool, bool verbose=false, bool include_mempool_sequence=false)
Mempool to JSON.
double GetDifficulty(const CBlockIndex *blockindex)
Get the difficulty of the net wrt to the given block index.
int64_t CAmount
Amount in satoshis (Can be negative)
UniValue blockheaderToJSON(const CBlockIndex *tip, const CBlockIndex *blockindex) LOCKS_EXCLUDED(cs_main)
Block header to JSON.
NodeContext struct containing references to chain state and connection state.
void RPCNotifyBlockChange(const CBlockIndex *)
Callback for when block tip changed.
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
CTxMemPool & EnsureMemPool(const util::Ref &context)
NodeContext & EnsureNodeContext(const util::Ref &context)
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.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
#define LOCKS_EXCLUDED(...)
The block chain is a tree shaped structure starting with the genesis block at the root...
UniValue blockToJSON(const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails=false) LOCKS_EXCLUDED(cs_main)
Block description to JSON.