aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-09-23 13:55:43 +0200
committerWladimir J. van der Laan <[email protected]>2016-09-23 13:56:01 +0200
commitd2e46558ba0e11aac4a05c3cf71146c0b6307c8e (patch)
tree7eac49ca8bf7f47f6c76e23c938d0f5a506d8313 /src/addrman.cpp
parentMerge #8793: Do not shadow in src/qt (diff)
parentDo not set an addr time penalty when a peer advertises itself. (diff)
downloaddiscoin-d2e46558ba0e11aac4a05c3cf71146c0b6307c8e.tar.xz
discoin-d2e46558ba0e11aac4a05c3cf71146c0b6307c8e.zip
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)
Diffstat (limited to 'src/addrman.cpp')
-rw-r--r--src/addrman.cpp5
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);