Skip to content

Commit eb3596f

Browse files
committed
Do not add random inbound peers to addrman.
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.
1 parent 53f8f22 commit eb3596f

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/main.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5029,12 +5029,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
50295029
pfrom->fGetAddr = true;
50305030
}
50315031
addrman.Good(pfrom->addr);
5032-
} else {
5033-
if (((CNetAddr)pfrom->addr) == (CNetAddr)addrFrom)
5034-
{
5035-
addrman.Add(addrFrom, addrFrom);
5036-
addrman.Good(addrFrom);
5037-
}
50385032
}
50395033

50405034
pfrom->fSuccessfullyConnected = true;

0 commit comments

Comments
 (0)