From 82de1b80d95fc9447e64c098dcadb6b8a2f1f2ee Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 9 Jun 2024 08:13:01 -0400 Subject: [PATCH] net: use GetRandMicros for cache expiration This matches the data type of m_cache_entry_expiration. --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 990c58ee3d8..ac665400228 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3475,7 +3475,7 @@ std::vector CConnman::GetAddresses(CNode& requestor, size_t max_addres // nodes to be "terrible" (see IsTerrible()) if the timestamps are older than 30 days, // max. 24 hours of "penalty" due to cache shouldn't make any meaningful difference // in terms of the freshness of the response. - cache_entry.m_cache_entry_expiration = current_time + std::chrono::hours(21) + GetRandMillis(std::chrono::hours(6)); + cache_entry.m_cache_entry_expiration = current_time + std::chrono::hours(21) + GetRandMicros(std::chrono::hours(6)); } return cache_entry.m_addrs_response_cache; }