Limit response to getblocks to half of output buffer size

Introduce SendBufferSize() and ReceiveBufferSize(), and limit
the blocks sent as response to the "getblocks" message to
half of the active send buffer size.
This commit is contained in:
Pieter Wuille
2011-06-30 23:29:44 +02:00
parent 44d16327c1
commit 4973174534
3 changed files with 11 additions and 5 deletions

View File

@@ -23,6 +23,8 @@ extern int nConnectTimeout;
inline unsigned int ReceiveBufferSize() { return 1000*GetArg("-maxreceivebuffer", 10*1000); }
inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 10*1000); }
inline unsigned short GetDefaultPort() { return fTestNet ? 18333 : 8333; }
static const unsigned int PUBLISH_HOPS = 5;
enum