Skip to content

Commit c38981e

Browse files
promagjonatack
authored andcommitted
p2p: pull time call out of loop in CAddrMan::GetAddr_()
1 parent d35ddca commit c38981e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/addrman.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ void CAddrMan::GetAddr_(std::vector<CAddress>& vAddr, size_t max_addresses, size
494494
}
495495

496496
// gather a list of random nodes, skipping those of low quality
497+
const int64_t now{GetAdjustedTime()};
497498
for (unsigned int n = 0; n < vRandom.size(); n++) {
498499
if (vAddr.size() >= nNodes)
499500
break;
@@ -508,7 +509,7 @@ void CAddrMan::GetAddr_(std::vector<CAddress>& vAddr, size_t max_addresses, size
508509
if (network != std::nullopt && ai.GetNetClass() != network) continue;
509510

510511
// Filter for quality
511-
if (ai.IsTerrible()) continue;
512+
if (ai.IsTerrible(now)) continue;
512513

513514
vAddr.push_back(ai);
514515
}

0 commit comments

Comments
 (0)