Browse Source

Improve readability of CAddrInfo::IsTerrible

- Replaced 86400 with 24*60*60
- Remove references to specific timespans in comments

Github-Pull: #4724
0.10
Teran McKinney 10 years ago committed by Wladimir J. van der Laan
parent
commit
f79323b0dd
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/addrman.cpp

6
src/addrman.cpp

@ -45,13 +45,13 @@ bool CAddrInfo::IsTerrible(int64_t nNow) const
if (nTime > nNow + 10*60) // came in a flying DeLorean if (nTime > nNow + 10*60) // came in a flying DeLorean
return true; return true;
if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*86400) // not seen in over a month if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*24*60*60) // not seen in recent history
return true; return true;
if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried three times and never a success if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried N times and never a success
return true; return true;
if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*86400 && nAttempts>=ADDRMAN_MAX_FAILURES) // 10 successive failures in the last week if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*24*60*60 && nAttempts>=ADDRMAN_MAX_FAILURES) // N successive failures in the last week
return true; return true;
return false; return false;

Loading…
Cancel
Save