mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Disconnect on mempool requests from peers when over the upload limit.
Mempool requests use a fair amount of bandwidth when the mempool is large, disconnecting peers using them follows the same logic as disconnecting peers fetching historical blocks.
This commit is contained in:
parent
5548d9cb11
commit
6aadc75578
@ -4981,6 +4981,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
|
|
||||||
else if (strCommand == "mempool")
|
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);
|
LOCK2(cs_main, pfrom->cs_filter);
|
||||||
|
|
||||||
std::vector<uint256> vtxid;
|
std::vector<uint256> vtxid;
|
||||||
|
Loading…
Reference in New Issue
Block a user