Move filtering banned addrs inside GetAddresses()

This commit is contained in:
Gleb Naumenko
2020-07-04 11:25:51 +03:00
parent 007e15dcd7
commit ded742bc5b
2 changed files with 8 additions and 5 deletions

View File

@@ -3480,10 +3480,7 @@ void ProcessMessage(
std::vector<CAddress> vAddr = connman.GetAddresses();
FastRandomContext insecure_rand;
for (const CAddress &addr : vAddr) {
bool banned_or_discouraged = banman && (banman->IsDiscouraged(addr) || banman->IsBanned(addr));
if (!banned_or_discouraged) {
pfrom.PushAddress(addr, insecure_rand);
}
pfrom.PushAddress(addr, insecure_rand);
}
return;
}