mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
p2p: pull time call out of loop in CAddrMan::GetAddr_()
This commit is contained in:
parent
d35ddca91e
commit
c38981e748
1 changed files with 2 additions and 1 deletions
|
@ -494,6 +494,7 @@ void CAddrMan::GetAddr_(std::vector<CAddress>& 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<CAddress>& 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue