From ba04c4a7801e7d68a5e84035b919e5c3626eb7a7 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 5 Mar 2015 04:01:22 -0800 Subject: Limit message sizes before transfer This introduces a fixed limit for the size of p2p messages, and enforces it before download. --- 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 d2b2d88ddb..24275d4a9d 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 */ -- cgit v1.2.3