test: addrman: tried 3 times and never a success so isTerrible=true #30445

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2024-07-test-addrman-isterrible changing 1 files +11 −2
  1. brunoerg commented at 5:11 pm on July 12, 2024: contributor

    This PR adds test coverage for the following verification:

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

    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:

     0diff --git a/src/addrman.cpp b/src/addrman.cpp
     1index 054a9bee32..93a9521b59 100644
     2--- a/src/addrman.cpp
     3+++ b/src/addrman.cpp
     4@@ -81,7 +81,7 @@ bool AddrInfo::IsTerrible(NodeSeconds now) const
     5     }
     6 
     7     if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success
     8-        return true;
     9+        return false;
    10     }
    
  2. test: addrman: tried 3 times and never a success so `isTerrible=true` ba2cf750f4
  3. DrahtBot commented at 5:11 pm on July 12, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. DrahtBot added the label Tests on Jul 12, 2024


brunoerg DrahtBot

Labels
Tests


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-08 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me