diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-11-18 09:19:09 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2022-02-11 15:21:49 +0100 |
commit | 97208634b96f2d9a55f2ead7b0ef407da729d7bd (patch) | |
tree | dcfd5e6b2bc512668d5f0337cb28aed21629cb5a /src/netbase.h | |
parent | bcecde64b4ad7bb8e717d5709af8fd17532755ab (diff) |
net: open p2p connections to nodes that listen on non-default ports
By default, for mainnet, the p2p listening port is 8333. Bitcoin Core
has a strong preference for only connecting to nodes that listen on that
port.
Remove that preference because connections over clearnet that involve
port 8333 make it easy to detect, analyze, block or divert Bitcoin p2p
traffic before the connection is even established (at TCP SYN time).
For further justification see the OP of:
https://github.com/bitcoin/bitcoin/pull/23306
Diffstat (limited to 'src/netbase.h')
-rw-r--r-- | src/netbase.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/netbase.h b/src/netbase.h index 980aa47d66..a8ff080662 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -247,4 +247,13 @@ void InterruptSocks5(bool interrupt); */ bool Socks5(const std::string& strDest, uint16_t port, const ProxyCredentials* auth, const Sock& socket); +/** + * Determine if a port is "bad" from the perspective of attempting to connect + * to a node on that port. + * @see doc/p2p-bad-ports.md + * @param[in] port Port to check. + * @returns whether the port is bad + */ +bool IsBadPort(uint16_t port); + #endif // BITCOIN_NETBASE_H |