diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-12-04 09:43:04 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-12-04 09:43:09 +0100 |
commit | 792259278e4f2e43d7e09f89335ed80979449b1d (patch) | |
tree | b1981615c79f249c42f239feaf259f1d2e925bfd | |
parent | 5548d9cb11c8e66fa4913aba5e7d28acc2c5a9d0 (diff) | |
parent | 6aadc7557823b7673b8f661b3d41cf867e2936a3 (diff) |
Merge pull request #7166
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
-rw-r--r-- | src/main.cpp | 6 |
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; |