aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicolas.dorier <nicolas.dorier@gmail.com>2019-06-21 11:31:12 +0900
committernicolas.dorier <nicolas.dorier@gmail.com>2019-08-11 11:33:27 +0900
commitecd5cf7ea4c3644a30092100ffc399e30e193275 (patch)
tree2132837f6235f75b7cb6b5319fe78e0c738fa3d6
parente5b26deaaa6842f7dd7c4537ede000f965ea0189 (diff)
Do not disconnect peer for asking mempool if it has NO_BAN permission
-rw-r--r--src/net_processing.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 5efb4adee6..5edb6ecf9b 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3012,15 +3012,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;
}