MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / IsTerrible

Method IsTerrible

src/addrman.cpp:50–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50bool AddrInfo::IsTerrible(NodeSeconds now) const
51{
52 if (now - m_last_try <= 1min) { // never remove things tried in the last minute
53 return false;
54 }
55
56 if (nTime > now + 10min) { // came in a flying DeLorean
57 return true;
58 }
59
60 if (now - nTime > ADDRMAN_HORIZON) { // not seen in recent history
61 return true;
62 }
63
64 if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success
65 return true;
66 }
67
68 if (now - m_last_success > ADDRMAN_MIN_FAIL && nAttempts >= ADDRMAN_MAX_FAILURES) { // N successive failures in the last week
69 return true;
70 }
71
72 return false;
73}
74
75double AddrInfo::GetChance(NodeSeconds now) const
76{

Callers 2

AddSingleMethod · 0.80
GetAddr_Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected