class BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockValidationRule {

    @Override
    public boolean isValid(Block block) {
        if (this.validPeriodLength == 0) {
            return true;
        }

        final long currentTime = System.currentTimeMillis() / 1000;
        final long blockTime = block.getTimestamp();

        boolean result = blockTime - currentTime <= this.validPeriodLength;

        if(!result) {
            logger.warn("Error validating block. Invalid timestamp {}.", blockTime);
        }

        return result;
    }

    public  BlockTimeStampValidationRule(int validPeriodLength);

}