diff options
author | Jon Atack <jon@atack.com> | 2020-10-21 11:52:19 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2020-12-17 19:56:10 +0100 |
commit | 6609eb8cb50fe92c7317b5db9e72d4333b3aab1b (patch) | |
tree | 922267bc8df6660793b3e42f41b8ed5ad579bbeb /src/net.cpp | |
parent | 993d1ecd191a7d9161082d4026f020cbf00835bb (diff) |
net: assert CNode::m_inbound_onion is inbound in ctor
and drop an unneeded check in CNode::ConnectedThroughNetwork()
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index b3c521116b..cf1ac35712 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -555,7 +555,7 @@ void CNode::SetAddrLocal(const CService& addrLocalIn) { Network CNode::ConnectedThroughNetwork() const { - return IsInboundConn() && m_inbound_onion ? NET_ONION : addr.GetNetClass(); + return m_inbound_onion ? NET_ONION : addr.GetNetClass(); } #undef X @@ -2954,6 +2954,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn nMyStartingHeight(nMyStartingHeightIn), m_inbound_onion(inbound_onion) { + if (inbound_onion) assert(conn_type_in == ConnectionType::INBOUND); hSocket = hSocketIn; addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn; hashContinue = uint256(); |