diff --git a/cppcheck/suppressions.txt b/cppcheck/suppressions.txt index 9cc7320..93de6fd 100644 --- a/cppcheck/suppressions.txt +++ b/cppcheck/suppressions.txt @@ -2,3 +2,4 @@ unmatchedSuppression missingIncludeSystem unusedFunction useStlAlgorithm +funcArgNamesDifferentUnnamed diff --git a/src/p2p_server.cpp b/src/p2p_server.cpp index 3a16a48..5926a7d 100644 --- a/src/p2p_server.cpp +++ b/src/p2p_server.cpp @@ -2402,12 +2402,11 @@ bool P2PServer::P2PClient::send_handshake_challenge() bool is_tor = false; - if ((m_addressType == AddressType::DomainName) && (strstr(m_addrString, ".onion:"))) { - // We're connecting to an .onion address - is_tor = true; - } - else if (!owner->m_pool->params().m_onionPubkey.empty() && m_isIncoming && (m_addressType != AddressType::DomainName) && m_addr.is_localhost()) { - // We published our .onion address, and it's an incoming connection on localhost interface, so it's likely an incoming tor connection + if (((m_addressType == AddressType::DomainName) && (strstr(m_addrString, ".onion:"))) || + (!owner->m_pool->params().m_onionPubkey.empty() && m_isIncoming && (m_addressType != AddressType::DomainName) && m_addr.is_localhost())) + { + // 1) We're connecting to an .onion address + // 2) We published our .onion address, and it's an incoming connection on localhost interface, so it's likely an incoming tor connection is_tor = true; }