code: public void verifyTransactions(final int height, final EnumSet<VerifyFlag> flags) throws VerificationException {
          // Now we need to check that the body of the block actually matches the headers. The network won't generate
          // 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-existent inputs.
          if (transactions.isEmpty())
              throw new VerificationException("Block had no transactions");
          if (this.getOptimalEncodingMessageSize() > MAX_BLOCK_SIZE)
              throw new VerificationException("Block larger than MAX_BLOCK_SIZE");
          checkTransactions(height, flags);
          checkMerkleRoot();
          checkSigOps();
          for (Transaction transaction : transactions)
              transaction.verify();
          }
docs: Checks the block contents
  
  @param height block height, if known, or -1 otherwise. If valid, used
  to validate the coinbase input script of v2 and above blocks.
  @param flags flags to indicate which tests should be applied (i.e.
  whether to test for height in the coinbase transaction).
  @throws VerificationException if there was an error verifying the block.