mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
refactor, move-only: Relocate CNode private members
This commit is contained in:
parent
0944024309
commit
acebb79d3f
1 changed files with 35 additions and 35 deletions
70
src/net.h
70
src/net.h
|
@ -605,41 +605,6 @@ public:
|
|||
CNode(const CNode&) = delete;
|
||||
CNode& operator=(const CNode&) = delete;
|
||||
|
||||
private:
|
||||
const NodeId id;
|
||||
const uint64_t nLocalHostNonce;
|
||||
const ConnectionType m_conn_type;
|
||||
std::atomic<int> m_greatest_common_version{INIT_PROTO_VERSION};
|
||||
|
||||
//! Services offered to this peer.
|
||||
//!
|
||||
//! This is supplied by the parent CConnman during peer connection
|
||||
//! (CConnman::ConnectNode()) from its attribute of the same name.
|
||||
//!
|
||||
//! This is const because there is no protocol defined for renegotiating
|
||||
//! services initially offered to a peer. The set of local services we
|
||||
//! offer should not change after initialization.
|
||||
//!
|
||||
//! An interesting example of this is NODE_NETWORK and initial block
|
||||
//! download: a node which starts up from scratch doesn't have any blocks
|
||||
//! to serve, but still advertises NODE_NETWORK because it will eventually
|
||||
//! fulfill this role after IBD completes. P2P code is written in such a
|
||||
//! way that it can gracefully handle peers who don't make good on their
|
||||
//! service advertisements.
|
||||
const ServiceFlags nLocalServices;
|
||||
|
||||
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
|
||||
|
||||
mutable RecursiveMutex cs_addrName;
|
||||
std::string addrName GUARDED_BY(cs_addrName);
|
||||
|
||||
// Our address, as reported by the peer
|
||||
CService addrLocal GUARDED_BY(cs_addrLocal);
|
||||
mutable RecursiveMutex cs_addrLocal;
|
||||
|
||||
//! Whether this peer is an inbound onion, e.g. connected via our Tor onion service.
|
||||
const bool m_inbound_onion{false};
|
||||
|
||||
public:
|
||||
|
||||
NodeId GetId() const {
|
||||
|
@ -760,6 +725,41 @@ public:
|
|||
|
||||
/** Whether this peer is an inbound onion, e.g. connected via our Tor onion service. */
|
||||
bool IsInboundOnion() const { return m_inbound_onion; }
|
||||
|
||||
private:
|
||||
const NodeId id;
|
||||
const uint64_t nLocalHostNonce;
|
||||
const ConnectionType m_conn_type;
|
||||
std::atomic<int> m_greatest_common_version{INIT_PROTO_VERSION};
|
||||
|
||||
//! Services offered to this peer.
|
||||
//!
|
||||
//! This is supplied by the parent CConnman during peer connection
|
||||
//! (CConnman::ConnectNode()) from its attribute of the same name.
|
||||
//!
|
||||
//! This is const because there is no protocol defined for renegotiating
|
||||
//! services initially offered to a peer. The set of local services we
|
||||
//! offer should not change after initialization.
|
||||
//!
|
||||
//! An interesting example of this is NODE_NETWORK and initial block
|
||||
//! download: a node which starts up from scratch doesn't have any blocks
|
||||
//! to serve, but still advertises NODE_NETWORK because it will eventually
|
||||
//! fulfill this role after IBD completes. P2P code is written in such a
|
||||
//! way that it can gracefully handle peers who don't make good on their
|
||||
//! service advertisements.
|
||||
const ServiceFlags nLocalServices;
|
||||
|
||||
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
|
||||
|
||||
mutable RecursiveMutex cs_addrName;
|
||||
std::string addrName GUARDED_BY(cs_addrName);
|
||||
|
||||
// Our address, as reported by the peer
|
||||
CService addrLocal GUARDED_BY(cs_addrLocal);
|
||||
mutable RecursiveMutex cs_addrLocal;
|
||||
|
||||
//! Whether this peer is an inbound onion, e.g. connected via our Tor onion service.
|
||||
const bool m_inbound_onion{false};
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue