Drop message decode max length to 4_000_000

It has been a long time since Bitcoin's maximum network message
length was 32MB, so we should follow suit. This is also an important
DoS limit, so we should limit it as much as possible.
This commit is contained in:
Matt Corallo 2019-11-06 16:29:21 -05:00
parent c8ac25219a
commit fe917765c0
1 changed files with 1 additions and 1 deletions

View File

@ -343,7 +343,7 @@ impl<R: Read> ReadExt for R {
}
/// Maximum size, in bytes, of a vector we are allowed to decode
pub const MAX_VEC_SIZE: usize = 32 * 1024 * 1024;
pub const MAX_VEC_SIZE: usize = 4_000_000;
/// Data which can be encoded in a consensus-consistent way
pub trait Encodable {