Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2021-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_RPC_SERVER_UTIL_H6#define BITCOIN_RPC_SERVER_UTIL_H8#include <any>10class AddrMan;11class ArgsManager;12class CBlockIndex;13class FeeRateEstimatorManager;14class CConnman;15class CTxMemPool;16class ChainstateManager;17class PeerManager;18class BanMan;19namespace Consensus {20struct Params;21} // namespace Consensus23namespace node {24struct NodeContext;25} // namespace node26namespace interfaces {27class Mining;28} // namespace interfaces30node::NodeContext& EnsureAnyNodeContext(const std::any& context);31CTxMemPool& EnsureMemPool(const node::NodeContext& node);32CTxMemPool& EnsureAnyMemPool(const std::any& context);33BanMan& EnsureBanman(const node::NodeContext& node);34BanMan& EnsureAnyBanman(const std::any& context);35ArgsManager& EnsureArgsman(const node::NodeContext& node);36ArgsManager& EnsureAnyArgsman(const std::any& context);37ChainstateManager& EnsureChainman(const node::NodeContext& node);38ChainstateManager& EnsureAnyChainman(const std::any& context);39FeeRateEstimatorManager& EnsureFeeEstimatorMan(const node::NodeContext& node);40FeeRateEstimatorManager& EnsureAnyFeeEstimatorMan(const std::any& context);41CConnman& EnsureConnman(const node::NodeContext& node);42interfaces::Mining& EnsureMining(const node::NodeContext& node);43PeerManager& EnsurePeerman(const node::NodeContext& node);44AddrMan& EnsureAddrman(const node::NodeContext& node);45AddrMan& EnsureAnyAddrman(const std::any& context);47/** Return an empty block index on top of the tip, with height, time and nBits set */48void NextEmptyBlockIndex(CBlockIndex& tip, const Consensus::Params& consensusParams, CBlockIndex& next_index);50#endif // BITCOIN_RPC_SERVER_UTIL_H