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 5f3612c2..f7660a21 100644 --- a/core/src/main/java/com/google/bitcoin/core/Block.java +++ b/core/src/main/java/com/google/bitcoin/core/Block.java @@ -678,7 +678,8 @@ public class Block extends Message { // an invalid block, but if we didn't validate this then an untrusted man-in-the-middle could obtain the next // valid block from the network and simply replace the transactions in it with their own fictional // transactions that reference spent or non-existant inputs. - Preconditions.checkState(!transactions.isEmpty()); + if (transactions.isEmpty()) + throw new VerificationException("Block had no transactions"); maybeParseTransactions(); checkTransactions(); checkMerkleRoot();