mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #20668: doc: warn that incoming conns are unlikely when not using default ports
010eed3ce0doc: warn that incoming conns are unlikely when not using default ports (Adam Jonas) Pull request description: Closes #5150. This was mostly copied from #5285 by sulks, who has since quit GitHub. The issue has remained open for 6 years, but the extra explanation still seems useful. ACKs for top commit: laanwj: re-ACK010eed3ce0Tree-SHA512: d240fb06bba41ad8898ced59356c10adefc09f3abb33e277f8e2c5980b40678f2d237f286b476451bb29d2b94032a7dee2ada3b2efe004ed1c2509e70b48e40f
This commit is contained in:
@@ -2074,7 +2074,11 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
|
||||
continue;
|
||||
}
|
||||
|
||||
// do not allow non-default ports, unless after 50 invalid addresses selected already
|
||||
// Do not allow non-default ports, unless after 50 invalid
|
||||
// addresses selected already. This is to prevent malicious peers
|
||||
// from advertising themselves as a service on another host and
|
||||
// port, causing a DoS attack as nodes around the network attempt
|
||||
// to connect to it fruitlessly.
|
||||
if (addr.GetPort() != Params().GetDefaultPort() && nTries < 50)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user