diff options
| author | Peter Todd <[email protected]> | 2016-05-20 14:44:32 +0100 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2016-05-20 16:40:37 +0200 |
| commit | beceac9bbf14bf4a81f6f63b9cca2a64157054ae (patch) | |
| tree | 13534b12b217ce27a9cc499e97a52ca6d1731daf /src/main.cpp | |
| parent | Merge #8056: [qa] Remove hardcoded "4 nodes" from test_framework (diff) | |
| download | discoin-beceac9bbf14bf4a81f6f63b9cca2a64157054ae.tar.xz discoin-beceac9bbf14bf4a81f6f63b9cca2a64157054ae.zip | |
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.
Diffstat (limited to 'src/main.cpp')
| -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 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()); |