test: cover out-of-range addr timestamp handling #36907

pull ViniciusCestarii wants to merge 1 commits into bitcoin:master from ViniciusCestarii:cover-addr-out-of-range changing 1 files +22 −0
  1. ViniciusCestarii commented at 10:51 PM on November 17, 2026: contributor

    Add a test that sends one address too far in the future and one too old and check addrman stores both as 5 days old.

    Kills the following mutants:

    diff --git a/src/net_processing.cpp b/src/net_processing.cpp
    index e25a4afd3d..236658dd32 100644
    --- a/src/net_processing.cpp
    +++ b/src/net_processing.cpp
    @@ -6014,7 +6014,7 @@ void PeerManagerImpl::ProcessAddrs(std::string_view msg_type, CNode& pfrom, Peer
             if (!MayHaveUsefulAddressDB(addr.nServices) && !HasAllDesirableServiceFlags(addr.nServices))
                 continue;
     
    -        if (addr.nTime <= NodeSeconds{100000000s} || addr.nTime > current_time + 10min) {
    +        if (addr.nTime <= NodeSeconds{100000000s} || false) {
                 addr.nTime = std::chrono::time_point_cast<std::chrono::seconds>(current_time - 5 * 24h);
             }
             AddAddressKnown(peer, addr);
    
    
    diff --git a/src/net_processing.cpp b/src/net_processing.cpp
    index e25a4afd3d..e5ff908d13 100644
    --- a/src/net_processing.cpp
    +++ b/src/net_processing.cpp
    @@ -6014,7 +6014,7 @@ void PeerManagerImpl::ProcessAddrs(std::string_view msg_type, CNode& pfrom, Peer
             if (!MayHaveUsefulAddressDB(addr.nServices) && !HasAllDesirableServiceFlags(addr.nServices))
                 continue;
     
    -        if (addr.nTime <= NodeSeconds{100000000s} || addr.nTime > current_time + 10min) {
    +        if (false || addr.nTime > current_time + 10min) {
                 addr.nTime = std::chrono::time_point_cast<std::chrono::seconds>(current_time - 5 * 24h);
             }
             AddAddressKnown(peer, addr);
    
    
  2. test: cover out-of-range addr timestamp handling f11fc55f41
  3. DrahtBot added the label Tests on Nov 17, 2026
  4. DrahtBot commented at 10:51 PM on November 17, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Labels

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-11-18 16:51 UTC

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