refactor, net: Increase CNode data member encapsulation

All protected CNode data members could be private.
This commit is contained in:
Hennadii Stepanov
2021-01-09 11:10:12 +02:00
parent acebb79d3f
commit 3642b2ed34

View File

@@ -528,11 +528,6 @@ public:
*/ */
Network ConnectedThroughNetwork() const; Network ConnectedThroughNetwork() const;
protected:
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend);
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);
public:
// We selected peer as (compact blocks) high-bandwidth peer (BIP152) // We selected peer as (compact blocks) high-bandwidth peer (BIP152)
std::atomic<bool> m_bip152_highbandwidth_to{false}; std::atomic<bool> m_bip152_highbandwidth_to{false};
// Peer selected us as (compact blocks) high-bandwidth peer (BIP152) // Peer selected us as (compact blocks) high-bandwidth peer (BIP152)
@@ -605,8 +600,6 @@ public:
CNode(const CNode&) = delete; CNode(const CNode&) = delete;
CNode& operator=(const CNode&) = delete; CNode& operator=(const CNode&) = delete;
public:
NodeId GetId() const { NodeId GetId() const {
return id; return id;
} }
@@ -657,8 +650,6 @@ public:
nRefCount--; nRefCount--;
} }
void AddAddressKnown(const CAddress& _addr) void AddAddressKnown(const CAddress& _addr)
{ {
assert(m_addr_known); assert(m_addr_known);
@@ -690,7 +681,6 @@ public:
} }
} }
void AddKnownTx(const uint256& hash) void AddKnownTx(const uint256& hash)
{ {
if (m_tx_relay != nullptr) { if (m_tx_relay != nullptr) {
@@ -760,6 +750,9 @@ private:
//! Whether this peer is an inbound onion, e.g. connected via our Tor onion service. //! Whether this peer is an inbound onion, e.g. connected via our Tor onion service.
const bool m_inbound_onion{false}; const bool m_inbound_onion{false};
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend);
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);
}; };
/** /**