mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
net: Add CNode::ConnectedThroughNetwork member function
This commit is contained in:
12
src/net.h
12
src/net.h
@@ -961,6 +961,18 @@ public:
|
||||
assert(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get network the peer connected through.
|
||||
*
|
||||
* Returns Network::NET_ONION for *inbound* onion connections,
|
||||
* and CNetAddr::GetNetClass() otherwise. The latter cannot be used directly
|
||||
* because it doesn't detect the former, and it's not the responsibility of
|
||||
* the CNetAddr class to know the actual network a peer is connected through.
|
||||
*
|
||||
* @return network the peer connected through.
|
||||
*/
|
||||
Network ConnectedThroughNetwork() const;
|
||||
|
||||
protected:
|
||||
mapMsgCmdSize mapSendBytesPerMsgCmd;
|
||||
mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY(cs_vRecv);
|
||||
|
||||
Reference in New Issue
Block a user