From 76181f5757845e06b929deda0aa3cd732fd29120 Mon Sep 17 00:00:00 2001
From: Oleg Girko
Date: Thu, 31 Aug 2017 16:34:24 +0100
Subject: [PATCH] Do not add random inbound peers to addrman. (#1593)
We should learn about new peers via address messages.
An inbound peer connecting to us tells us nothing about
its ability to accept incoming connections from us, so
we shouldn't assume that we can connect to it based on
this.
The vast majority of nodes on the network do not accept
incoming connections, adding them will only slow down
the process of making a successful connection in the
future.
Nodes which have configured themselves to not announce would prefer we
not violate their privacy by announcing them in GETADDR responses.
---
src/net_processing.cpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 9814416ee..7c3c1317b 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1231,12 +1231,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
pfrom->fGetAddr = true;
}
connman.MarkAddressGood(pfrom->addr);
- } else {
- if (((CNetAddr)pfrom->addr) == (CNetAddr)addrFrom)
- {
- connman.AddNewAddress(addrFrom, addrFrom);
- connman.MarkAddressGood(addrFrom);
- }
}
// Relay alerts