Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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 <cassert>
9#include <functional>
10#include <memory>
11#include <vector>
12
13class ArgsManager;
14class BanMan;
15class AddrMan;
16class CConnman;
17class CScheduler;
18class CTxMemPool;
20class PeerManager;
21namespace interfaces {
22class Chain;
23class ChainClient;
24class WalletClient;
25} // namespace interfaces
26namespace avalanche {
27class Processor;
28} // namespace avalanche
29
30namespace node {
31class KernelNotifications;
32
44 std::unique_ptr<AddrMan> addrman;
45 std::unique_ptr<CConnman> connman;
46 std::unique_ptr<CTxMemPool> mempool;
47 std::unique_ptr<PeerManager> peerman;
48 std::unique_ptr<ChainstateManager> chainman;
49 std::unique_ptr<BanMan> banman;
50 // Currently a raw pointer because the memory is not managed by this struct
51 ArgsManager *args{nullptr};
52 std::unique_ptr<interfaces::Chain> chain;
55 std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;
59 std::unique_ptr<CScheduler> scheduler;
60 std::function<void()> rpc_interruption_point = [] {};
61 std::unique_ptr<KernelNotifications> notifications;
62
63 std::unique_ptr<avalanche::Processor> avalanche;
64
70};
71} // namespace node
72
73#endif // BITCOIN_NODE_CONTEXT_H
Stochastic address manager.
Definition addrman.h:68
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:212
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Wallet chain client that in addition to having chain client methods for starting up,...
Definition wallet.h:304
Definition init.h:28
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
NodeContext struct containing references to chain state and connection state.
Definition context.h:43
std::unique_ptr< CConnman > connman
Definition context.h:45
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:55
std::unique_ptr< CTxMemPool > mempool
Definition context.h:46
std::unique_ptr< BanMan > banman
Definition context.h:49
std::unique_ptr< avalanche::Processor > avalanche
Definition context.h:63
std::unique_ptr< AddrMan > addrman
Definition context.h:44
std::function< void()> rpc_interruption_point
Definition context.h:60
std::unique_ptr< ChainstateManager > chainman
Definition context.h:48
NodeContext()
Declare default constructor and destructor that are not inline, so code instantiating the NodeContext...
Definition context.cpp:19
std::unique_ptr< KernelNotifications > notifications
Definition context.h:61
std::unique_ptr< CScheduler > scheduler
Definition context.h:59
interfaces::WalletClient * wallet_client
Reference to chain client that should used to load or create wallets opened by the gui.
Definition context.h:58
std::unique_ptr< PeerManager > peerman
Definition context.h:47
ArgsManager * args
Definition context.h:51
std::unique_ptr< interfaces::Chain > chain
Definition context.h:52