Skip to content

Commit ecd5cf7

Browse files
committed
Do not disconnect peer for asking mempool if it has NO_BAN permission
1 parent e5b26de commit ecd5cf7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/net_processing.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,15 +3012,21 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
30123012
if (strCommand == NetMsgType::MEMPOOL) {
30133013
if (!(pfrom->GetLocalServices() & NODE_BLOOM) && !pfrom->fWhitelisted)
30143014
{
3015-
LogPrint(BCLog::NET, "mempool request with bloom filters disabled, disconnect peer=%d\n", pfrom->GetId());
3016-
pfrom->fDisconnect = true;
3015+
if (!pfrom->HasPermission(PF_NOBAN))
3016+
{
3017+
LogPrint(BCLog::NET, "mempool request with bloom filters disabled, disconnect peer=%d\n", pfrom->GetId());
3018+
pfrom->fDisconnect = true;
3019+
}
30173020
return true;
30183021
}
30193022

30203023
if (connman->OutboundTargetReached(false) && !pfrom->fWhitelisted)
30213024
{
3022-
LogPrint(BCLog::NET, "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId());
3023-
pfrom->fDisconnect = true;
3025+
if (!pfrom->HasPermission(PF_NOBAN))
3026+
{
3027+
LogPrint(BCLog::NET, "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId());
3028+
pfrom->fDisconnect = true;
3029+
}
30243030
return true;
30253031
}
30263032

0 commit comments

Comments
 (0)