Changeset View
Changeset View
Standalone View
Standalone View
src/node/context.h
Show All 28 Lines | |||||
//! without needing to declare the same variables and parameters repeatedly, or | //! without needing to declare the same variables and parameters repeatedly, or | ||||
//! to use globals. More variables could be added to this struct (particularly | //! to use globals. More variables could be added to this struct (particularly | ||||
//! references to validation objects) to eliminate use of globals | //! references to validation objects) to eliminate use of globals | ||||
//! and make code more modular and testable. The struct isn't intended to have | //! and make code more modular and testable. The struct isn't intended to have | ||||
//! any member functions. It should just be a collection of references that can | //! any member functions. It should just be a collection of references that can | ||||
//! be used without pulling in unwanted dependencies or functionality. | //! be used without pulling in unwanted dependencies or functionality. | ||||
struct NodeContext { | struct NodeContext { | ||||
std::unique_ptr<CConnman> connman; | std::unique_ptr<CConnman> connman; | ||||
// Currently a raw pointer because the memory is not managed by this struct | std::unique_ptr<CTxMemPool> mempool; | ||||
CTxMemPool *mempool{nullptr}; | |||||
std::unique_ptr<PeerManager> peerman; | std::unique_ptr<PeerManager> peerman; | ||||
// Currently a raw pointer because the memory is not managed by this struct | // Currently a raw pointer because the memory is not managed by this struct | ||||
ChainstateManager *chainman{nullptr}; | ChainstateManager *chainman{nullptr}; | ||||
std::unique_ptr<BanMan> banman; | std::unique_ptr<BanMan> banman; | ||||
// Currently a raw pointer because the memory is not managed by this struct | // Currently a raw pointer because the memory is not managed by this struct | ||||
ArgsManager *args{nullptr}; | ArgsManager *args{nullptr}; | ||||
std::unique_ptr<interfaces::Chain> chain; | std::unique_ptr<interfaces::Chain> chain; | ||||
std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients; | std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients; | ||||
Show All 11 Lines |