From c38981e748f438d972ba12ba998c8a8a597e01c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Wed, 12 May 2021 16:53:25 +0200 Subject: [PATCH] p2p: pull time call out of loop in CAddrMan::GetAddr_() --- src/addrman.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index ae2f1c23a2..ceab1689d7 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -494,6 +494,7 @@ void CAddrMan::GetAddr_(std::vector& vAddr, size_t max_addresses, size } // gather a list of random nodes, skipping those of low quality + const int64_t now{GetAdjustedTime()}; for (unsigned int n = 0; n < vRandom.size(); n++) { if (vAddr.size() >= nNodes) break; @@ -508,7 +509,7 @@ void CAddrMan::GetAddr_(std::vector& vAddr, size_t max_addresses, size if (network != std::nullopt && ai.GetNetClass() != network) continue; // Filter for quality - if (ai.IsTerrible()) continue; + if (ai.IsTerrible(now)) continue; vAddr.push_back(ai); }