Merge #8661: Do not set an addr time penalty when a peer advertises itself.

6d0ced1 Do not set an addr time penalty when a peer advertises itself. (Gregory Maxwell)
This commit is contained in:
Wladimir J. van der Laan 2016-09-23 13:55:43 +02:00
commit d2e46558ba
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

View File

@ -255,6 +255,11 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
int nId;
CAddrInfo* pinfo = Find(addr, &nId);
// Do not set a penality for a source's self-announcement
if (addr == source) {
nTimePenalty = 0;
}
if (pinfo) {
// periodically update nTime
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);