diff options
author | Peter Todd <pete@petertodd.org> | 2016-05-20 14:44:32 +0100 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-05-20 16:40:37 +0200 |
commit | beceac9bbf14bf4a81f6f63b9cca2a64157054ae (patch) | |
tree | 13534b12b217ce27a9cc499e97a52ca6d1731daf | |
parent | 8844ef15ded02d5ed86fb95aaf251235fcef2396 (diff) | |
download | bitcoin-beceac9bbf14bf4a81f6f63b9cca2a64157054ae.tar.xz |
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.
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 9ba90b4ead..2ad2a8e3f1 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()); |