Skip to content

Commit

Permalink
refactor: do the easy check first in AddrManImpl::GetAddr_
Browse files Browse the repository at this point in the history
Avoid needless developer head-scratching; there is no point
in calling `IsTerrible()` if the boolean `filtered` is false.
  • Loading branch information
jonatack committed Nov 8, 2024
1 parent 8421d9f commit b285a59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ std::vector<CAddress> AddrManImpl::GetAddr_(size_t max_addresses, size_t max_pct
if (network != std::nullopt && ai.GetNetClass() != network) continue;

// Filter for quality (optional)
if (ai.IsTerrible(now) && filtered) continue;
if (filtered && ai.IsTerrible(now)) continue;

addresses.push_back(ai);
}
Expand Down

0 comments on commit b285a59

Please sign in to comment.