aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2019-03-20 11:37:55 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2019-03-20 11:38:08 +0100
commit81f732bcaa30edcc16a0d85e3d56e7a1d4845ae1 (patch)
tree50ceadb260d1531994044c3378de4967c4bb7c4b
parente45b7f20e651898c5b476c2364fd9d1fd583f3af (diff)
parent054d01d0a87a5adc43428588ecc29f1339a69dd2 (diff)
Merge #15617: p2p: Do not relay banned IP addresses
054d01d0a87a5adc43428588ecc29f1339a69dd2 Do not relay banned IP addresses (Pieter Wuille) Pull request description: Tree-SHA512: 538c43781c789949e1ae566533e76835d478e40e8ba6427b22234ee611cb4a311b2940a214e37c1e9c9afe28a6814a00d490a39e3580bb5ebd85b03e95040246
-rw-r--r--src/net_processing.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 18dd2f010c..a37451e39a 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -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())
{
@@ -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;
}