Do not set an addr time penalty when a peer advertises itself.
Claims a peer makes about itself are inherently more credible.
This commit is contained in:
parent
cbe9ae8c69
commit
6d0ced1865
1 changed files with 5 additions and 0 deletions
|
@ -255,6 +255,11 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
|
||||||
int nId;
|
int nId;
|
||||||
CAddrInfo* pinfo = Find(addr, &nId);
|
CAddrInfo* pinfo = Find(addr, &nId);
|
||||||
|
|
||||||
|
// Do not set a penality for a source's self-announcement
|
||||||
|
if (addr == source) {
|
||||||
|
nTimePenalty = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (pinfo) {
|
if (pinfo) {
|
||||||
// periodically update nTime
|
// periodically update nTime
|
||||||
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
|
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
|
||||||
|
|
Loading…
Reference in a new issue