[#CNode-ConnectedThroughNetwork]
= xref:CNode.adoc[CNode]::ConnectedThroughNetwork
:relfileprefix: ../
:mrdocs:

Get network the peer connected through&period;

== Synopsis

Declared in `&lt;net&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:Network.adoc[Network]
ConnectedThroughNetwork() const;
----

== Description

Returns Network&colon;&colon;NET&lowbar;ONION for _inbound_ onion connections, and CNetAddr&colon;&colon;GetNetClass() otherwise&period; The latter cannot be used directly because it doesn&apos;t detect the former, and it&apos;s not the responsibility of the CNetAddr class to know the actual network a peer is connected through&period;

== Return Value

network the peer connected through&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
