Skip to content

Commit d2e4655

Browse files
committed
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)
2 parents 5d0219d + 6d0ced1 commit d2e4655

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/addrman.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
255255
int nId;
256256
CAddrInfo* pinfo = Find(addr, &nId);
257257

258+
// Do not set a penality for a source's self-announcement
259+
if (addr == source) {
260+
nTimePenalty = 0;
261+
}
262+
258263
if (pinfo) {
259264
// periodically update nTime
260265
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);

0 commit comments

Comments
 (0)