Bitcoin Core  29.1.0
P2P Digital Currency
server_util.h
Go to the documentation of this file.
1 // Copyright (c) 2021-2022 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_RPC_SERVER_UTIL_H
6 #define BITCOIN_RPC_SERVER_UTIL_H
7 
8 #include <any>
9 
10 #include <consensus/params.h>
11 
12 class AddrMan;
13 class ArgsManager;
14 class CBlockIndex;
16 class CConnman;
17 class CTxMemPool;
18 class ChainstateManager;
19 class PeerManager;
20 class BanMan;
21 namespace node {
22 struct NodeContext;
23 } // namespace node
24 namespace interfaces {
25 class Mining;
26 } // namespace interfaces
27 
28 node::NodeContext& EnsureAnyNodeContext(const std::any& context);
30 CTxMemPool& EnsureAnyMemPool(const std::any& context);
32 BanMan& EnsureAnyBanman(const std::any& context);
34 ArgsManager& EnsureAnyArgsman(const std::any& context);
36 ChainstateManager& EnsureAnyChainman(const std::any& context);
38 CBlockPolicyEstimator& EnsureAnyFeeEstimator(const std::any& context);
43 AddrMan& EnsureAnyAddrman(const std::any& context);
44 
46 void NextEmptyBlockIndex(CBlockIndex& tip, const Consensus::Params& consensusParams, CBlockIndex& next_index);
47 
48 #endif // BITCOIN_RPC_SERVER_UTIL_H
AddrMan & EnsureAnyAddrman(const std::any &context)
Definition: banman.h:58
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition: validation.h:865
BanMan & EnsureAnyBanman(const std::any &context)
Definition: server_util.cpp:56
CTxMemPool & EnsureAnyMemPool(const std::any &context)
Definition: server_util.cpp:42
CConnman & EnsureConnman(const node::NodeContext &node)
ArgsManager & EnsureAnyArgsman(const std::any &context)
Definition: server_util.cpp:69
Stochastic address manager.
Definition: addrman.h:88
NodeContext struct containing references to chain state and connection state.
Definition: context.h:56
Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block te...
Definition: mining.h:63
ArgsManager & EnsureArgsman(const node::NodeContext &node)
Definition: server_util.cpp:61
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
Definition: fees.h:148
PeerManager & EnsurePeerman(const node::NodeContext &node)
Definition: net.h:1051
Parameters that influence chain consensus.
Definition: params.h:74
CTxMemPool & EnsureMemPool(const node::NodeContext &node)
Definition: server_util.cpp:34
Definition: messages.h:20
node::NodeContext & EnsureAnyNodeContext(const std::any &context)
Definition: server_util.cpp:25
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:303
AddrMan & EnsureAddrman(const node::NodeContext &node)
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:140
interfaces::Mining & EnsureMining(const node::NodeContext &node)
ChainstateManager & EnsureAnyChainman(const std::any &context)
Definition: server_util.cpp:82
CBlockPolicyEstimator & EnsureAnyFeeEstimator(const std::any &context)
Definition: server_util.cpp:95
void NextEmptyBlockIndex(CBlockIndex &tip, const Consensus::Params &consensusParams, CBlockIndex &next_index)
Return an empty block index on top of the tip, with height, time and nBits set.
CBlockPolicyEstimator & EnsureFeeEstimator(const node::NodeContext &node)
Definition: server_util.cpp:87
BanMan & EnsureBanman(const node::NodeContext &node)
Definition: server_util.cpp:48
ChainstateManager & EnsureChainman(const node::NodeContext &node)
Definition: server_util.cpp:74