Ava Chow e8cc790fe2
Merge bitcoin/bitcoin#30445: test: addrman: tried 3 times and never a success so isTerrible=true
1807df3d9fb0135057a33e01173080ea14b0403d test: addrman: tried 3 times and never a success so `isTerrible=true` (brunoerg)

Pull request description:

  This PR adds test coverage for the following verification:
  ```cpp
  if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success
      return true;
  }
  ```

  If we've tried an address for 3 or more times and were unsuccessful, this address should be pointed out as "terrible".

  -------

  You can test this by applying:
  ```diff
  diff --git a/src/addrman.cpp b/src/addrman.cpp
  index 054a9bee32..93a9521b59 100644
  --- a/src/addrman.cpp
  +++ b/src/addrman.cpp
  @@ -81,7 +81,7 @@ bool AddrInfo::IsTerrible(NodeSeconds now) const
       }

       if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success
  -        return true;
  +        return false;
       }
  ```

ACKs for top commit:
  jonatack:
    re-ACK 1807df3d9fb0135057a33e01173080ea14b0403d
  naumenkogs:
    ACK 1807df3d9fb0135057a33e01173080ea14b0403d
  achow101:
    ACK 1807df3d9fb0135057a33e01173080ea14b0403d

Tree-SHA512: e3cc43c98bddfe90f585d5b4bd00543be443b77ecaf038615261aa8cc4d14fc2f1006d0b00c04188040eaace455c5c6dbb3bb200a2c0f29c3b4ef5128bf0973a
2024-12-04 15:34:59 -05:00
..
2024-11-15 19:14:54 +01:00
2024-10-25 18:09:36 +01:00
2024-08-29 13:49:57 +02:00
2024-11-20 22:55:25 +01:00
2024-11-20 22:55:25 +01:00
2024-09-17 09:54:18 +02:00
2024-11-11 14:14:39 +00:00
2024-11-26 20:47:08 -05:00
2024-11-20 22:55:26 +01:00
2024-08-04 08:51:36 +02:00
2024-05-20 16:48:19 +00:00
2024-07-08 11:12:01 +02:00
2024-09-10 11:20:40 -03:00
2024-11-11 14:14:39 +00:00
2024-10-21 23:24:17 +02:00
2024-10-21 23:24:17 +02:00
2024-07-08 11:12:01 +02:00
2024-08-29 13:49:57 +02:00
2024-07-08 11:12:01 +02:00
2024-09-06 17:36:18 +02:00
2023-11-16 11:36:22 +10:00