diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-23 13:55:43 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-23 13:56:01 +0200 |
commit | d2e46558ba0e11aac4a05c3cf71146c0b6307c8e (patch) | |
tree | 7eac49ca8bf7f47f6c76e23c938d0f5a506d8313 | |
parent | 5d0219d983b6cb8de5b4faf3f78a6781c99e442b (diff) | |
parent | 6d0ced18655a4f3619a6f478846f3241f1d040f7 (diff) |
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)
-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); |