test: addrman: check isTerrible when time is more than 10min in the future #33533

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2025-10-addrman-test-10min changing 1 files +7 −1
  1. brunoerg commented at 1:29 PM on October 3, 2025: contributor

    This PR adds test coverage to kill the following mutant (https://corecheck.dev/mutation/src/addrman.cpp#L76):

    diff --git a/src/addrman.cpp b/src/addrman.cpp
    index 9c3a24db90..0ffd349315 100644
    --- a/src/addrman.cpp
    +++ b/src/addrman.cpp
    @@ -73,7 +73,7 @@ bool AddrInfo::IsTerrible(NodeSeconds now) const
         }
    
         if (nTime > now + 10min) { // came in a flying DeLorean
    -        return true;
    +        return false;
         }
    

    When the nTime is set 10 minutes in the future the addr should be marked as terrible.

  2. test: addrman: check isTerrible when time is more than 10min in the future 8e47ed6906
  3. DrahtBot added the label Tests on Oct 3, 2025
  4. DrahtBot commented at 1:29 PM on October 3, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33533.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Crypt-iQ, danielabrozzoni, marcofleon

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • should be isTerrible = true -> should be isTerrible == true [makes the intent clear that this is a boolean check rather than an assignment; improves readability of the comment]

    <sup>drahtbot_id_5_m</sup>

  5. Crypt-iQ commented at 2:49 PM on October 3, 2025: contributor

    crACK 8e47ed6906d5e381498681e2cab9f2e318597705

  6. fanquake requested review from marcofleon on Oct 3, 2025
  7. danielabrozzoni commented at 5:42 PM on October 3, 2025: member

    tACK 8e47ed6906d5e381498681e2cab9f2e318597705

    I verified that mutating the isTerrible condition did not cause any tests to fail on master, while this PR correctly triggers a test failure.

  8. marcofleon commented at 5:54 PM on October 3, 2025: contributor

    Nice, code review ACK 8e47ed6906d5e381498681e2cab9f2e318597705

  9. fanquake merged this on Oct 3, 2025
  10. fanquake closed this on Oct 3, 2025

  11. sedited referenced this in commit 3f14dd4b2a on Oct 7, 2025
  12. sedited referenced this in commit 5f9d179b8d on Oct 8, 2025
  13. sedited referenced this in commit 845b93d99e on Oct 8, 2025
  14. yuvicc referenced this in commit ccce70c31a on Oct 8, 2025
  15. sedited referenced this in commit 3b1e26d5d3 on Oct 10, 2025
  16. sedited referenced this in commit 0fa2fdaca0 on Oct 11, 2025
  17. stringintech referenced this in commit f74b275ffc on Oct 14, 2025
  18. stickies-v referenced this in commit a785fe6759 on Nov 5, 2025
  19. Kino1994 referenced this in commit c4b1228dd8 on Jun 28, 2026
  20. BigcoinBGC referenced this in commit b07f9d9af0 on Jun 30, 2026
  21. Kino1994 referenced this in commit 4781f6bcb4 on Aug 19, 2026
  22. bitcoin locked this on Oct 3, 2026

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: 2026-10-11 08:51 UTC

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