diff options
author | Gregory Maxwell <greg@xiph.org> | 2016-09-03 10:24:37 +0000 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2016-09-03 10:24:37 +0000 |
commit | 6d0ced18655a4f3619a6f478846f3241f1d040f7 (patch) | |
tree | 2ba364b3d4230628a43f055e8d1b5ff45af2197d /src/addrman.cpp | |
parent | cbe9ae8c69b947c8cdff2e0fbf5b57c9aa09b770 (diff) |
Do not set an addr time penalty when a peer advertises itself.
Claims a peer makes about itself are inherently more credible.
Diffstat (limited to 'src/addrman.cpp')
-rw-r--r-- | src/addrman.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp index cebb1c8e5e..bfb8e94575 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); |