diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2019-03-17 22:05:49 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-03-20 11:40:34 +0100 |
commit | 238ef336929606632f0564e417ee0b6fd649c2a9 (patch) | |
tree | 0e1020fa643f3c02dda7e154ac754ed1e928dd10 | |
parent | d3a038200709c48922faab96d0ba558a574fa4d9 (diff) |
Do not relay banned IP addresses
Github-Pull: #15617
Rebased-From: 054d01d0a87a5adc43428588ecc29f1339a69dd2
Tree-SHA512: 2c47cf823cc51aee5a224513a0ca2fd1132f4c567d255ead661e88f009dc5d1db73da79b5e65a63b11b222e17292fdff9035a93cb2e53215d9bbb21a5bce7a41
-rw-r--r-- | src/net_processing.cpp | 8 |
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; } |