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);