mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
net: assert CNode::m_inbound_onion is inbound in ctor
and drop an unneeded check in CNode::ConnectedThroughNetwork()
This commit is contained in:
parent
993d1ecd19
commit
6609eb8cb5
2 changed files with 3 additions and 2 deletions
|
@ -555,7 +555,7 @@ void CNode::SetAddrLocal(const CService& addrLocalIn) {
|
||||||
|
|
||||||
Network CNode::ConnectedThroughNetwork() const
|
Network CNode::ConnectedThroughNetwork() const
|
||||||
{
|
{
|
||||||
return IsInboundConn() && m_inbound_onion ? NET_ONION : addr.GetNetClass();
|
return m_inbound_onion ? NET_ONION : addr.GetNetClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef X
|
#undef X
|
||||||
|
@ -2954,6 +2954,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
|
||||||
nMyStartingHeight(nMyStartingHeightIn),
|
nMyStartingHeight(nMyStartingHeightIn),
|
||||||
m_inbound_onion(inbound_onion)
|
m_inbound_onion(inbound_onion)
|
||||||
{
|
{
|
||||||
|
if (inbound_onion) assert(conn_type_in == ConnectionType::INBOUND);
|
||||||
hSocket = hSocketIn;
|
hSocket = hSocketIn;
|
||||||
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
|
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
|
||||||
hashContinue = uint256();
|
hashContinue = uint256();
|
||||||
|
|
|
@ -1110,7 +1110,7 @@ private:
|
||||||
CService addrLocal GUARDED_BY(cs_addrLocal);
|
CService addrLocal GUARDED_BY(cs_addrLocal);
|
||||||
mutable RecursiveMutex cs_addrLocal;
|
mutable RecursiveMutex cs_addrLocal;
|
||||||
|
|
||||||
//! Whether this peer connected via our Tor onion service.
|
//! Whether this peer is an inbound onion, e.g. connected via our Tor onion service.
|
||||||
const bool m_inbound_onion{false};
|
const bool m_inbound_onion{false};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Reference in a new issue