diff options
| author | Gregory Maxwell <[email protected]> | 2016-09-03 10:24:37 +0000 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2016-09-03 10:24:37 +0000 |
| commit | 6d0ced18655a4f3619a6f478846f3241f1d040f7 (patch) | |
| tree | 2ba364b3d4230628a43f055e8d1b5ff45af2197d /src/addrman.cpp | |
| parent | Merge #8466: [Trivial] Do not shadow variables in networking code (diff) | |
| download | discoin-6d0ced18655a4f3619a6f478846f3241f1d040f7.tar.xz discoin-6d0ced18655a4f3619a6f478846f3241f1d040f7.zip | |
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 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); |