mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 18:53:21 +01:00
Merge bitcoin/bitcoin#29393: i2p: log connection was refused due to arbitrary port
5b358cdd1ai2p: log connection was refused due to arbitrary port (brunoerg) Pull request description: For I2P, we do not try to connect if port is != 0. However, we do not have anything that indicates it or any error when trying to connect with port != 0. This PR adds a log for it. Also, it improves the functional test. With this log we can ensure the reason we won't connect is the port, in the current test, we cannot ensure it. ACKs for top commit: jonatack: ACK5b358cdd1aepiccurious: re-ACK5b358cdd1a. achow101: ACK5b358cdd1akristapsk: re-ACK5b358cdd1avasild: ACK5b358cdd1aTree-SHA512: 027245afa771c9295fff0bfd17c251dca4a9f4c739e5773922de3c030a65ef05d96291edcbdeeaa50ba3add61f75f28d8c00be503e03fc33d3491d1956fc549f
This commit is contained in:
@@ -217,6 +217,7 @@ bool Session::Connect(const CService& to, Connection& conn, bool& proxy_error)
|
||||
// Refuse connecting to arbitrary ports. We don't specify any destination port to the SAM proxy
|
||||
// when connecting (SAM 3.1 does not use ports) and it forces/defaults it to I2P_SAM31_PORT.
|
||||
if (to.GetPort() != I2P_SAM31_PORT) {
|
||||
Log("Error connecting to %s, connection refused due to arbitrary port %s", to.ToStringAddrPort(), to.GetPort());
|
||||
proxy_error = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user