diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-12-04 09:43:04 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-12-04 09:43:09 +0100 |
| commit | 792259278e4f2e43d7e09f89335ed80979449b1d (patch) | |
| tree | b1981615c79f249c42f239feaf259f1d2e925bfd /src/main.cpp | |
| parent | Merge pull request #7152 (diff) | |
| parent | Disconnect on mempool requests from peers when over the upload limit. (diff) | |
| download | discoin-792259278e4f2e43d7e09f89335ed80979449b1d.tar.xz discoin-792259278e4f2e43d7e09f89335ed80979449b1d.zip | |
Merge pull request #7166
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
Diffstat (limited to 'src/main.cpp')
| -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 bfa71a729..22e71c0c4 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; |