Skip to content

Commit 3642b2e

Browse files
committed
refactor, net: Increase CNode data member encapsulation
All protected CNode data members could be private.
1 parent acebb79 commit 3642b2e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/net.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,6 @@ class CNode
528528
*/
529529
Network ConnectedThroughNetwork() const;
530530

531-
protected:
532-
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend);
533-
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);
534-
535-
public:
536531
// We selected peer as (compact blocks) high-bandwidth peer (BIP152)
537532
std::atomic<bool> m_bip152_highbandwidth_to{false};
538533
// Peer selected us as (compact blocks) high-bandwidth peer (BIP152)
@@ -605,8 +600,6 @@ class CNode
605600
CNode(const CNode&) = delete;
606601
CNode& operator=(const CNode&) = delete;
607602

608-
public:
609-
610603
NodeId GetId() const {
611604
return id;
612605
}
@@ -657,8 +650,6 @@ class CNode
657650
nRefCount--;
658651
}
659652

660-
661-
662653
void AddAddressKnown(const CAddress& _addr)
663654
{
664655
assert(m_addr_known);
@@ -690,7 +681,6 @@ class CNode
690681
}
691682
}
692683

693-
694684
void AddKnownTx(const uint256& hash)
695685
{
696686
if (m_tx_relay != nullptr) {
@@ -760,6 +750,9 @@ class CNode
760750

761751
//! Whether this peer is an inbound onion, e.g. connected via our Tor onion service.
762752
const bool m_inbound_onion{false};
753+
754+
mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY(cs_vSend);
755+
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);
763756
};
764757

765758
/**

0 commit comments

Comments
 (0)