Changeset View
Changeset View
Standalone View
Standalone View
src/node/context.h
// Copyright (c) 2019 The Bitcoin Core developers | // Copyright (c) 2019 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_NODE_CONTEXT_H | #ifndef BITCOIN_NODE_CONTEXT_H | ||||
#define BITCOIN_NODE_CONTEXT_H | #define BITCOIN_NODE_CONTEXT_H | ||||
#include <memory> | #include <memory> | ||||
#include <vector> | #include <vector> | ||||
class BanMan; | class BanMan; | ||||
class CConnman; | class CConnman; | ||||
class CScheduler; | |||||
class CTxMemPool; | class CTxMemPool; | ||||
class PeerLogicValidation; | class PeerLogicValidation; | ||||
namespace interfaces { | namespace interfaces { | ||||
class Chain; | class Chain; | ||||
class ChainClient; | class ChainClient; | ||||
} // namespace interfaces | } // namespace interfaces | ||||
//! NodeContext struct containing references to chain state and connection | //! NodeContext struct containing references to chain state and connection | ||||
Show All 9 Lines | |||||
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 | // Currently a raw pointer because the memory is not managed by this struct | ||||
CTxMemPool *mempool{nullptr}; | CTxMemPool *mempool{nullptr}; | ||||
std::unique_ptr<PeerLogicValidation> peer_logic; | std::unique_ptr<PeerLogicValidation> peer_logic; | ||||
std::unique_ptr<BanMan> banman; | std::unique_ptr<BanMan> banman; | ||||
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; | ||||
std::unique_ptr<CScheduler> scheduler; | |||||
//! Declare default constructor and destructor that are not inline, so code | //! Declare default constructor and destructor that are not inline, so code | ||||
//! instantiating the NodeContext struct doesn't need to #include class | //! instantiating the NodeContext struct doesn't need to #include class | ||||
//! definitions for all the unique_ptr members. | //! definitions for all the unique_ptr members. | ||||
NodeContext(); | NodeContext(); | ||||
~NodeContext(); | ~NodeContext(); | ||||
}; | }; | ||||
#endif // BITCOIN_NODE_CONTEXT_H | #endif // BITCOIN_NODE_CONTEXT_H |