aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-03-05 04:01:22 -0800
committerWladimir J. van der Laan <laanwj@gmail.com>2015-03-09 11:13:35 +0100
commitd5d89980284179436a5f3009a5346581fdaa9a01 (patch)
tree3a90734c4c2e0853054dd7fa030deb6fb27d1779 /src/net.h
parent786cf72c7ff5d4042e7a7d010e96e53b0a597371 (diff)
downloadbitcoin-d5d89980284179436a5f3009a5346581fdaa9a01.tar.xz
Limit message sizes before transfer
This introduces a fixed limit for the size of p2p messages, and enforces it before download. Rebased-From: ba04c4a7801e7d68a5e84035b919e5c3626eb7a7 Github-Pull: #5843
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 a475be0b33..79d8baeb6d 100644
--- a/src/net.h
+++ b/src/net.h
@@ -46,6 +46,8 @@ static const int TIMEOUT_INTERVAL = 20 * 60;
static const unsigned int MAX_INV_SZ = 50000;
/** The maximum number of new addresses to accumulate before announcing. */
static const unsigned int MAX_ADDR_TO_SEND = 1000;
+/** Maximum length of incoming protocol messages (no message over 2 MiB is currently acceptable). */
+static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 2 * 1024 * 1024;
/** -listen default */
static const bool DEFAULT_LISTEN = true;
/** -upnp default */