diff options
author | nicolas.dorier <nicolas.dorier@gmail.com> | 2019-06-21 11:31:12 +0900 |
---|---|---|
committer | nicolas.dorier <nicolas.dorier@gmail.com> | 2019-08-11 11:33:27 +0900 |
commit | ecd5cf7ea4c3644a30092100ffc399e30e193275 (patch) | |
tree | 2132837f6235f75b7cb6b5319fe78e0c738fa3d6 | |
parent | e5b26deaaa6842f7dd7c4537ede000f965ea0189 (diff) |
Do not disconnect peer for asking mempool if it has NO_BAN permission
-rw-r--r-- | src/net_processing.cpp | 14 |
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; } |