diff --git a/core/src/main/java/com/google/bitcoin/core/Block.java b/core/src/main/java/com/google/bitcoin/core/Block.java index fd53cd5d..a0140ba1 100644 --- a/core/src/main/java/com/google/bitcoin/core/Block.java +++ b/core/src/main/java/com/google/bitcoin/core/Block.java @@ -722,6 +722,8 @@ public class Block extends Message { if (transactions.isEmpty()) throw new VerificationException("Block had no transactions"); maybeParseTransactions(); + if (this.getMessageSize() > MAX_BLOCK_SIZE) + throw new VerificationException("Block larger than MAX_BLOCK_SIZE"); checkTransactions(); checkMerkleRoot(); checkSigOps();