mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 06:44:16 +00:00
Make a block with no txn a VerificationException, not Precondition
This commit is contained in:
parent
dfebcc83ab
commit
1cbd5c07b4
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user