diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-09-30 19:19:19 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-10-03 15:38:19 +0300 |
commit | 49fba9c1aa699d3aa47ea4dafe07b47c8d0aac6e (patch) | |
tree | e58b1df3d151cb25d898e14a095b12d455ba7894 /src/net.h | |
parent | d4dde24034d7467883b290111da60527ab8048f8 (diff) |
net: Add CNode::ConnectedThroughNetwork member function
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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); |