From beceac9bbf14bf4a81f6f63b9cca2a64157054ae Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Fri, 20 May 2016 14:44:32 +0100 Subject: [PATCH] Disable the mempool P2P command when bloom filters disabled Only useful to SPV peers, and attackers... like bloom is a DoS vector as far more data is sent than received. --- src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 9ba90b4ea..2ad2a8e3f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5277,6 +5277,13 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, else if (strCommand == NetMsgType::MEMPOOL) { + if (!(nLocalServices & NODE_BLOOM) && !pfrom->fWhitelisted) + { + LogPrint("net", "mempool request with bloom filters disabled, disconnect peer=%d\n", pfrom->GetId()); + pfrom->fDisconnect = true; + return true; + } + if (CNode::OutboundTargetReached(false) && !pfrom->fWhitelisted) { LogPrint("net", "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId());