| 48 | } |
| 49 | |
| 50 | bool 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 | |
| 75 | double AddrInfo::GetChance(NodeSeconds now) const |
| 76 | { |