From 497317453422611a077f7f195eb193d3bb597a9c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 30 Jun 2011 23:29:44 +0200 Subject: 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. --- src/net.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index 8a55856eed..afa264b723 100644 --- a/src/net.h +++ b/src/net.h @@ -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 -- cgit v1.2.3