Bitcoin Core  0.19.99
P2P Digital Currency
context.h
Go to the documentation of this file.
1 // Copyright (c) 2019 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_NODE_CONTEXT_H
6 #define BITCOIN_NODE_CONTEXT_H
7 
8 #include <memory>
9 #include <vector>
10 
11 class BanMan;
12 class CConnman;
13 class CScheduler;
14 class CTxMemPool;
16 namespace interfaces {
17 class Chain;
18 class ChainClient;
19 } // namespace interfaces
20 
31 struct NodeContext {
32  std::unique_ptr<CConnman> connman;
33  CTxMemPool* mempool{nullptr}; // Currently a raw pointer because the memory is not managed by this struct
34  std::unique_ptr<PeerLogicValidation> peer_logic;
35  std::unique_ptr<BanMan> banman;
36  std::unique_ptr<interfaces::Chain> chain;
37  std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;
38  std::unique_ptr<CScheduler> scheduler;
39 
43  NodeContext();
44  ~NodeContext();
45 };
46 
47 #endif // BITCOIN_NODE_CONTEXT_H
CTxMemPool mempool
std::vector< std::unique_ptr< interfaces::ChainClient > > chain_clients
Definition: context.h:37
Definition: banman.h:41
std::unique_ptr< BanMan > banman
Definition: context.h:35
std::unique_ptr< interfaces::Chain > chain
Definition: context.h:36
NodeContext struct containing references to chain state and connection state.
Definition: context.h:31
std::unique_ptr< CConnman > connman
Definition: context.h:32
Definition: net.h:121
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:443
std::unique_ptr< PeerLogicValidation > peer_logic
Definition: context.h:34
std::unique_ptr< CScheduler > scheduler
Definition: context.h:38