Set the recovery block range if we're restoring and reporcessing
    transactions from a backup.

    Writes the recovery range to the working directory if the working directory is given and persist is True

def set_recovery_range(working_dir, start_block, end_block):
    """
    Set the recovery block range if we're restoring and reporcessing
    transactions from a backup.

    Writes the recovery range to the working directory if the working directory is given and persist is True
    """
    recovery_range_path = os.path.join(working_dir, '.recovery')
    with open(recovery_range_path, 'w') as f:
        f.write('{}\n{}\n'.format(start_block, end_block))
        f.flush()
        os.fsync(f.fileno())