Skip to content

Commit

Permalink
Merge #15617: p2p: Do not relay banned IP addresses
Browse files Browse the repository at this point in the history
054d01d Do not relay banned IP addresses (Pieter Wuille)

Pull request description:

Tree-SHA512: 538c43781c789949e1ae566533e76835d478e40e8ba6427b22234ee611cb4a311b2940a214e37c1e9c9afe28a6814a00d490a39e3580bb5ebd85b03e95040246
  • Loading branch information
laanwj committed Mar 20, 2019
2 parents e45b7f2 + 054d01d commit 81f732b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
addr.nTime = nNow - 5 * 24 * 60 * 60;
pfrom->AddAddressKnown(addr);
if (g_banman->IsBanned(addr)) continue; // Do not process banned addresses beyond remembering we received them
bool fReachable = IsReachable(addr);
if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())
{
Expand Down Expand Up @@ -2912,8 +2913,11 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
pfrom->vAddrToSend.clear();
std::vector<CAddress> vAddr = connman->GetAddresses();
FastRandomContext insecure_rand;
for (const CAddress &addr : vAddr)
pfrom->PushAddress(addr, insecure_rand);
for (const CAddress &addr : vAddr) {
if (!g_banman->IsBanned(addr)) {
pfrom->PushAddress(addr, insecure_rand);
}
}
return true;
}

Expand Down

0 comments on commit 81f732b

Please sign in to comment.