Skip to content

Commit

Permalink
Merge bitcoin#8661: Do not set an addr time penalty when a peer adver…
Browse files Browse the repository at this point in the history
…tises itself.

6d0ced1 Do not set an addr time penalty when a peer advertises itself. (Gregory Maxwell)
  • Loading branch information
laanwj authored and codablock committed Jan 11, 2018
1 parent c7a0b91 commit 39d2131
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/addrman.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 39d2131

Please sign in to comment.