Skip to content

Commit

Permalink
Do not disconnect peer for asking mempool if it has NO_BAN permission
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#16248
Rebased-From: ecd5cf7
  • Loading branch information
NicolasDorier authored and luke-jr committed Sep 2, 2019
1 parent e077460 commit a4ee744
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/net_processing.cpp
Expand Up @@ -2795,15 +2795,21 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
if (strCommand == NetMsgType::MEMPOOL) {
if (!(pfrom->GetLocalServices() & NODE_BLOOM) && !pfrom->fWhitelisted)
{
LogPrint(BCLog::NET, "mempool request with bloom filters disabled, disconnect peer=%d\n", pfrom->GetId());
pfrom->fDisconnect = true;
if (!pfrom->HasPermission(PF_NOBAN))
{
LogPrint(BCLog::NET, "mempool request with bloom filters disabled, disconnect peer=%d\n", pfrom->GetId());
pfrom->fDisconnect = true;
}
return true;
}

if (connman->OutboundTargetReached(false) && !pfrom->fWhitelisted)
{
LogPrint(BCLog::NET, "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId());
pfrom->fDisconnect = true;
if (!pfrom->HasPermission(PF_NOBAN))
{
LogPrint(BCLog::NET, "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId());
pfrom->fDisconnect = true;
}
return true;
}

Expand Down

0 comments on commit a4ee744

Please sign in to comment.