Bitcoin ABC 0.31.0
P2P Digital Currency
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 <kernel/context.h>
9
10#include <cassert>
11#include <functional>
12#include <memory>
13#include <vector>
14
15class ArgsManager;
16class AddrMan;
17class BanMan;
18class BaseIndex;
19class CConnman;
20class CScheduler;
21class CTxMemPool;
23class PeerManager;
24namespace interfaces {
25class Chain;
26class ChainClient;
27class WalletClient;
28} // namespace interfaces
29namespace avalanche {
30class Processor;
31} // namespace avalanche
32
33namespace node {
34class KernelNotifications;
35
48 std::unique_ptr<kernel::Context> kernel;
49 std::unique_ptr<AddrMan> addrman;
50 std::unique_ptr<CConnman> connman;
51 std::unique_ptr<CTxMemPool> mempool;
52 std::unique_ptr<PeerManager> peerman;
53 std::unique_ptr<ChainstateManager> chainman;
54 std::unique_ptr<BanMan> banman;
55 // Currently a raw pointer because the memory is not managed by this struct
56 ArgsManager *args{nullptr};
57 // raw pointers because memory is not managed by this struct
58 std::vector<BaseIndex *> indexes;
59 std::unique_ptr<interfaces::Chain> chain;
62 std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;
66 std::unique_ptr<CScheduler> scheduler;
67 std::function<void()> rpc_interruption_point = [] {};
68 std::unique_ptr<KernelNotifications> notifications;
69
70 std::unique_ptr<avalanche::Processor> avalanche;
71
77};
78} // namespace node
79
80#endif // BITCOIN_NODE_CONTEXT_H
Stochastic address manager.
Definition: addrman.h:68
Definition: banman.h:58
Base class for indices of blockchain data.
Definition: base.h:37
Definition: net.h:856
Simple class for background tasks that should be run periodically or once "after a while".
Definition: scheduler.h:41
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:214
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition: validation.h:1147
Wallet chain client that in addition to having chain client methods for starting up,...
Definition: wallet.h:304
Definition: init.h:31
NodeContext struct containing references to chain state and connection state.
Definition: context.h:46
std::vector< BaseIndex * > indexes
Definition: context.h:58
std::unique_ptr< CConnman > connman
Definition: context.h:50
std::unique_ptr< kernel::Context > kernel
libbitcoin_kernel context
Definition: context.h:48
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:62
std::unique_ptr< CTxMemPool > mempool
Definition: context.h:51
std::unique_ptr< BanMan > banman
Definition: context.h:54
std::unique_ptr< avalanche::Processor > avalanche
Definition: context.h:70
std::unique_ptr< AddrMan > addrman
Definition: context.h:49
std::function< void()> rpc_interruption_point
Definition: context.h:67
std::unique_ptr< ChainstateManager > chainman
Definition: context.h:53
NodeContext()
Declare default constructor and destructor that are not inline, so code instantiating the NodeContext...
Definition: context.cpp:20
std::unique_ptr< KernelNotifications > notifications
Definition: context.h:68
std::unique_ptr< CScheduler > scheduler
Definition: context.h:66
interfaces::WalletClient * wallet_client
Reference to chain client that should used to load or create wallets opened by the gui.
Definition: context.h:65
std::unique_ptr< PeerManager > peerman
Definition: context.h:52
ArgsManager * args
Definition: context.h:56
std::unique_ptr< interfaces::Chain > chain
Definition: context.h:59