From e4871065b0a9f19651ae07e5e0b9619b9d4ccc0f Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Thu, 15 Mar 2018 18:36:44 +0000 Subject: [PATCH] Bounding block timestamp to avoid surprises. Fixes #783 --- core/src/core/block.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/core/block.rs b/core/src/core/block.rs index 4bb9bc605..d6cc8b997 100644 --- a/core/src/core/block.rs +++ b/core/src/core/block.rs @@ -186,6 +186,10 @@ impl Readable for BlockHeader { let total_kernel_offset = BlindingFactor::read(reader)?; let pow = Proof::read(reader)?; + if timestamp > (1 << 60) { + return Err(ser::Error::CorruptedData); + } + Ok(BlockHeader { version: version, height: height,