mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 21:42:47 +01:00
Don't waste work on slow peers until they catch up
This commit is contained in:
parent
a42627b5ec
commit
218e2ea912
@ -3068,6 +3068,12 @@ void static ProcessGetData(CNode* pfrom)
|
|||||||
if (pfrom->nSendSize >= SendBufferSize())
|
if (pfrom->nSendSize >= SendBufferSize())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Don't waste work on slow peers until they catch up on the blocks we
|
||||||
|
// give them. 80 bytes is just the size of a block header - obviously
|
||||||
|
// the minimum we might return.
|
||||||
|
if (pfrom->nBlocksRequested * 80 > pfrom->nSendBytes)
|
||||||
|
break;
|
||||||
|
|
||||||
const CInv &inv = *it;
|
const CInv &inv = *it;
|
||||||
{
|
{
|
||||||
boost::this_thread::interruption_point();
|
boost::this_thread::interruption_point();
|
||||||
|
Loading…
Reference in New Issue
Block a user