Bitcoin Core 28.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
context.h
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 http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_NODE_CONTEXT_H
6#define BITCOIN_NODE_CONTEXT_H
7
8#include <atomic>
9#include <cstdlib>
10#include <functional>
11#include <memory>
12#include <vector>
13
14class ArgsManager;
15class AddrMan;
16class BanMan;
17class BaseIndex;
19class CConnman;
21class CScheduler;
22class CTxMemPool;
24class ECC_Context;
25class NetGroupManager;
26class PeerManager;
27namespace interfaces {
28class Chain;
29class ChainClient;
30class Mining;
31class Init;
32class WalletLoader;
33} // namespace interfaces
34namespace kernel {
35struct Context;
36}
37namespace util {
38class SignalInterrupt;
39}
40
41namespace node {
42class KernelNotifications;
43class Warnings;
44
57 std::unique_ptr<kernel::Context> kernel;
58 std::unique_ptr<ECC_Context> ecc_context;
63 std::unique_ptr<AddrMan> addrman;
64 std::unique_ptr<CConnman> connman;
65 std::unique_ptr<CTxMemPool> mempool;
66 std::unique_ptr<const NetGroupManager> netgroupman;
67 std::unique_ptr<CBlockPolicyEstimator> fee_estimator;
68 std::unique_ptr<PeerManager> peerman;
69 std::unique_ptr<ChainstateManager> chainman;
70 std::unique_ptr<BanMan> banman;
71 ArgsManager* args{nullptr}; // Currently a raw pointer because the memory is not managed by this struct
72 std::vector<BaseIndex*> indexes; // raw pointers because memory is not managed by this struct
73 std::unique_ptr<interfaces::Chain> chain;
75 std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;
78 std::unique_ptr<interfaces::Mining> mining;
80 std::unique_ptr<CScheduler> scheduler;
81 std::function<void()> rpc_interruption_point = [] {};
83 std::unique_ptr<KernelNotifications> notifications;
85 std::unique_ptr<ValidationSignals> validation_signals;
86 std::atomic<int> exit_status{EXIT_SUCCESS};
88 std::unique_ptr<node::Warnings> warnings;
89
95};
96} // namespace node
97
98#endif // BITCOIN_NODE_CONTEXT_H
return EXIT_SUCCESS
Stochastic address manager.
Definition addrman.h:88
Base class for indices of blockchain data.
Definition base.h:41
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
Definition fees.h:149
Simple class for background tasks that should be run periodically or once "after a while".
Definition scheduler.h:40
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition txmempool.h:304
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition validation.h:871
RAII class initializing and deinitializing global state for elliptic curve support.
Definition key.h:322
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:31
Wallet chain client that in addition to having chain client methods for starting up,...
Definition wallet.h:328
Helper class that manages an interrupt flag, and allows a thread or signal to interrupt another threa...
NodeContext struct containing references to chain state and connection state.
Definition context.h:55
std::unique_ptr< ValidationSignals > validation_signals
Issues calls about blocks and transactions.
Definition context.h:85
std::unique_ptr< CConnman > connman
Definition context.h:64
std::unique_ptr< kernel::Context > kernel
libbitcoin_kernel context
Definition context.h:57
std::vector< BaseIndex * > indexes
Definition context.h:72
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:75
std::unique_ptr< CTxMemPool > mempool
Definition context.h:65
std::unique_ptr< BanMan > banman
Definition context.h:70
std::unique_ptr< interfaces::Mining > mining
Reference to chain client that should used to load or create wallets opened by the gui.
Definition context.h:78
std::unique_ptr< AddrMan > addrman
Definition context.h:63
std::function< void()> rpc_interruption_point
Definition context.h:81
std::unique_ptr< ChainstateManager > chainman
Definition context.h:69
std::unique_ptr< node::Warnings > warnings
Manages all the node warnings.
Definition context.h:88
NodeContext()
Declare default constructor and destructor that are not inline, so code instantiating the NodeContext...
std::unique_ptr< KernelNotifications > notifications
Issues blocking calls about sync status, errors and warnings.
Definition context.h:83
std::unique_ptr< CScheduler > scheduler
Definition context.h:80
std::unique_ptr< CBlockPolicyEstimator > fee_estimator
Definition context.h:67
std::unique_ptr< PeerManager > peerman
Definition context.h:68
ArgsManager * args
Definition context.h:71
std::atomic< int > exit_status
Definition context.h:86
std::unique_ptr< const NetGroupManager > netgroupman
Definition context.h:66
interfaces::WalletLoader * wallet_loader
Definition context.h:79
std::unique_ptr< ECC_Context > ecc_context
Definition context.h:58
util::SignalInterrupt * shutdown
Interrupt object used to track whether node shutdown was requested.
Definition context.h:62
std::unique_ptr< interfaces::Chain > chain
Definition context.h:73