Skip to content

Commit

Permalink
Do not add random inbound peers to addrman.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gmaxwell committed Aug 25, 2016
1 parent 53f8f22 commit eb3596f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/main.cpp
Expand Up @@ -5029,12 +5029,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
pfrom->fGetAddr = true;
}
addrman.Good(pfrom->addr);
} else {
if (((CNetAddr)pfrom->addr) == (CNetAddr)addrFrom)
{
addrman.Add(addrFrom, addrFrom);
addrman.Good(addrFrom);
}
}

pfrom->fSuccessfullyConnected = true;
Expand Down

0 comments on commit eb3596f

Please sign in to comment.