MCPcopy Create free account
hub / github.com/LUX-Core/lux / IsTerrible

Method IsTerrible

src/addrman.cpp:36–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool CAddrInfo::IsTerrible(int64_t nNow) const
37{
38 if (nLastTry && nLastTry >= nNow - 60) // never remove things tried in the last minute
39 return false;
40
41 if (nTime > nNow + 10 * 60) // came in a flying DeLorean
42 return true;
43
44 if (nTime == 0 || nNow - nTime > ADDRMAN_HORIZON_DAYS * 24 * 60 * 60) // not seen in recent history
45 return true;
46
47 if (nLastSuccess == 0 && nAttempts >= ADDRMAN_RETRIES) // tried N times and never a success
48 return true;
49
50 if (nNow - nLastSuccess > ADDRMAN_MIN_FAIL_DAYS * 24 * 60 * 60 && nAttempts >= ADDRMAN_MAX_FAILURES) // N successive failures in the last week
51 return true;
52
53 return false;
54}
55
56double CAddrInfo::GetChance(int64_t nNow) const
57{

Callers 2

Add_Method · 0.80
GetAddr_Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected