mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Do not relay banned IP addresses
Github-Pull: #15617
Rebased-From: 054d01d0a8
Tree-SHA512: 2c47cf823cc51aee5a224513a0ca2fd1132f4c567d255ead661e88f009dc5d1db73da79b5e65a63b11b222e17292fdff9035a93cb2e53215d9bbb21a5bce7a41
This commit is contained in:
parent
d3a0382007
commit
238ef33692
1 changed files with 6 additions and 2 deletions
|
|
@ -2022,6 +2022,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||||
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
|
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
|
||||||
addr.nTime = nNow - 5 * 24 * 60 * 60;
|
addr.nTime = nNow - 5 * 24 * 60 * 60;
|
||||||
pfrom->AddAddressKnown(addr);
|
pfrom->AddAddressKnown(addr);
|
||||||
|
if (g_banman->IsBanned(addr)) continue; // Do not process banned addresses beyond remembering we received them
|
||||||
bool fReachable = IsReachable(addr);
|
bool fReachable = IsReachable(addr);
|
||||||
if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())
|
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();
|
pfrom->vAddrToSend.clear();
|
||||||
std::vector<CAddress> vAddr = connman->GetAddresses();
|
std::vector<CAddress> vAddr = connman->GetAddresses();
|
||||||
FastRandomContext insecure_rand;
|
FastRandomContext insecure_rand;
|
||||||
for (const CAddress &addr : vAddr)
|
for (const CAddress &addr : vAddr) {
|
||||||
pfrom->PushAddress(addr, insecure_rand);
|
if (!g_banman->IsBanned(addr)) {
|
||||||
|
pfrom->PushAddress(addr, insecure_rand);
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue