Skip to content

Commit 44a4a01

Browse files
committed
Merge bitcoin#30064: net: log connections failures via SOCKS5 with less severity
f3cfbd6 net: log connections failures via SOCKS5 with less severity (Vasil Dimov) Pull request description: It is expected to have some Bitcoin nodes unreachable some of the time. A failure to connect to an IPv4 or IPv6 node is already properly logged under category=net/severity=debug. Do the same when a connection fails when using a SOCKS5 proxy. This could be either to an .onion address or to an IPv4 or IPv6 address (via a Tor exit node). Related: bitcoin#29759 ACKs for top commit: achow101: ACK f3cfbd6 mzumsande: Code Review ACK f3cfbd6 tdb3: Code Review ACK f3cfbd6 Tree-SHA512: c6e83568783cb5233edac7840a00f708d27be9af87480fc73093ad99fe4bd8670d3f2c97fd6b6e2c54b8d9337746eacb9a5db6eefecc1486951996bfbb0a37f7
2 parents 2917f41 + f3cfbd6 commit 44a4a01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/netbase.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ bool Socks5(const std::string& strDest, uint16_t port, const ProxyCredentials* a
456456
}
457457
if (pchRet2[1] != SOCKS5Reply::SUCCEEDED) {
458458
// Failures to connect to a peer that are not proxy errors
459-
LogPrintf("Socks5() connect to %s:%d failed: %s\n", strDest, port, Socks5ErrorString(pchRet2[1]));
459+
LogPrintLevel(BCLog::NET, BCLog::Level::Debug,
460+
"Socks5() connect to %s:%d failed: %s\n", strDest, port, Socks5ErrorString(pchRet2[1]));
460461
return false;
461462
}
462463
if (pchRet2[2] != 0x00) { // Reserved field must be 0
@@ -584,7 +585,7 @@ static bool ConnectToSocket(const Sock& sock, struct sockaddr* sockaddr, socklen
584585
NetworkErrorString(WSAGetLastError()));
585586
return false;
586587
} else if (occurred == 0) {
587-
LogPrint(BCLog::NET, "connection attempt to %s timed out\n", dest_str);
588+
LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "connection attempt to %s timed out\n", dest_str);
588589
return false;
589590
}
590591

0 commit comments

Comments
 (0)