src/main/java/toy/blockchain/Blockchain.java
/**
     * Validate a block hash with respect to the latest block in the chain.
     * @param b the block to be validated
     * @return true if valid, false if not
     */
Validate a block hash with respect to the latest block in the chain.
@param b the block to be validated
@return true if valid, false if not
Validate a block hash with respect to the latest block in the chain . @param b the block to be validated @return true if valid false if not
public boolean validateBlockHash(Types.Block b) {
        byte[] d = DigestMethod.hash(blocks.get(b.getHeader().getHeight() - 1).getHeader().toByteArray());
        return DigestMethod.validate(b.getHeader().getPrev().toByteArray(),
                Objects.requireNonNull(d));
    }
public boolean validateBlockHash ( Types . Block b ) { byte [ ] d = DigestMethod . hash ( blocks . get ( b . getHeader ( ) . getHeight ( ) - 1 ) . getHeader ( ) . toByteArray ( ) ) ; return DigestMethod . validate ( b . getHeader ( ) . getPrev ( ) . toByteArray ( ) , Objects . requireNonNull ( d ) ) ; }
Validate a block hash with respect to the latest block in the chain.
Validate a block hash with respect to the latest block in the chain .