Bitcoin Core  25.99.0
P2P Digital Currency
Go to the documentation of this file.
1 // Copyright (c) 2019-2022 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or
8 #include <kernel/context.h>
10 #include <cassert>
11 #include <functional>
12 #include <memory>
13 #include <vector>
15 class ArgsManager;
16 class BanMan;
17 class AddrMan;
19 class CConnman;
20 class CScheduler;
21 class CTxMemPool;
22 class ChainstateManager;
23 class NetGroupManager;
24 class PeerManager;
25 namespace interfaces {
26 class Chain;
27 class ChainClient;
28 class Init;
29 class WalletLoader;
30 } // namespace interfaces
32 namespace node {
33 class KernelNotifications;
45 struct NodeContext {
47  std::unique_ptr<kernel::Context> kernel;
50  std::unique_ptr<AddrMan> addrman;
51  std::unique_ptr<CConnman> connman;
52  std::unique_ptr<CTxMemPool> mempool;
53  std::unique_ptr<const NetGroupManager> netgroupman;
54  std::unique_ptr<CBlockPolicyEstimator> fee_estimator;
55  std::unique_ptr<PeerManager> peerman;
56  std::unique_ptr<ChainstateManager> chainman;
57  std::unique_ptr<BanMan> banman;
58  ArgsManager* args{nullptr}; // Currently a raw pointer because the memory is not managed by this struct
59  std::unique_ptr<interfaces::Chain> chain;
61  std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;
65  std::unique_ptr<CScheduler> scheduler;
66  std::function<void()> rpc_interruption_point = [] {};
67  std::unique_ptr<KernelNotifications> notifications;
74 };
75 } // namespace node
Stochastic address manager.
Definition: addrman.h:87
Definition: banman.h:59
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
Definition: fees.h:133
Definition: net.h:696
Simple class for background tasks that should be run periodically or once "after a while".
Definition: scheduler.h:39
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:316
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition: validation.h:870
Netgroup manager.
Definition: netgroup.h:16
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:30
Wallet chain client that in addition to having chain client methods for starting up,...
Definition: wallet.h:321
Definition: init.h:25
NodeContext struct containing references to chain state and connection state.
Definition: context.h:45
std::unique_ptr< CConnman > connman
Definition: context.h:51
std::unique_ptr< kernel::Context > kernel
libbitcoin_kernel context
Definition: context.h:47
std::vector< std::unique_ptr< interfaces::ChainClient > > chain_clients
List of all chain clients (wallet processes or other client) connected to node.
Definition: context.h:61
std::unique_ptr< CTxMemPool > mempool
Definition: context.h:52
std::unique_ptr< BanMan > banman
Definition: context.h:57
std::unique_ptr< AddrMan > addrman
Definition: context.h:50
std::function< void()> rpc_interruption_point
Definition: context.h:66
std::unique_ptr< ChainstateManager > chainman
Definition: context.h:56
Declare default constructor and destructor that are not inline, so code instantiating the NodeContext...
std::unique_ptr< KernelNotifications > notifications
Definition: context.h:67
std::unique_ptr< CScheduler > scheduler
Definition: context.h:65
std::unique_ptr< CBlockPolicyEstimator > fee_estimator
Definition: context.h:54
std::unique_ptr< PeerManager > peerman
Definition: context.h:55
ArgsManager * args
Definition: context.h:58
std::unique_ptr< const NetGroupManager > netgroupman
Definition: context.h:53
interfaces::WalletLoader * wallet_loader
Reference to chain client that should used to load or create wallets opened by the gui.
Definition: context.h:64
std::unique_ptr< interfaces::Chain > chain
Definition: context.h:59