public Optional<Integer> getTransactionCount(final long blockNumber) {
    if (outsideBlockchainRange(blockNumber)) {
      return Optional.empty();
    }
    return blockchain.getBlockHashByNumber(blockNumber).map(this::getTransactionCount);
  }
Returns the number of transactions in the block at the given height.

@param blockNumber The height of the block being queried.
@return The number of transactions contained in the referenced block.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java