aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2011-06-30 23:29:44 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2011-07-01 09:39:44 +0200
commit497317453422611a077f7f195eb193d3bb597a9c (patch)
tree3063ec6de27084fd37a62d72bdefb8eee28558c7 /src/net.h
parent44d16327c19f033169171678e58bd779301e87d5 (diff)
downloadbitcoin-497317453422611a077f7f195eb193d3bb597a9c.tar.xz
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.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h2
1 files changed, 2 insertions, 0 deletions
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