From 6d0ced18655a4f3619a6f478846f3241f1d040f7 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sat, 3 Sep 2016 10:24:37 +0000 Subject: [PATCH] Do not set an addr time penalty when a peer advertises itself. Claims a peer makes about itself are inherently more credible. --- src/addrman.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/addrman.cpp b/src/addrman.cpp index cebb1c8e5..bfb8e9457 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -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);