aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-12-04 09:43:04 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-12-04 09:43:09 +0100
commit792259278e4f2e43d7e09f89335ed80979449b1d (patch)
treeb1981615c79f249c42f239feaf259f1d2e925bfd /src
parent5548d9cb11c8e66fa4913aba5e7d28acc2c5a9d0 (diff)
parent6aadc7557823b7673b8f661b3d41cf867e2936a3 (diff)
downloadbitcoin-792259278e4f2e43d7e09f89335ed80979449b1d.tar.xz
Merge pull request #7166
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index bfa71a7292..22e71c0c48 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4981,6 +4981,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
else if (strCommand == "mempool")
{
+ if (CNode::OutboundTargetReached(false) && !pfrom->fWhitelisted)
+ {
+ LogPrint("net", "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId());
+ pfrom->fDisconnect = true;
+ return true;
+ }
LOCK2(cs_main, pfrom->cs_filter);
std::vector<uint256> vtxid;