'Read the next block and verify the data.
Raises an IOError if the hash does not match.'

def _next_block(self, block_stream):

    index = read_int(block_stream, 4)
    bhash = block_stream.read(32)
    length = read_int(block_stream, 4)
    if (length > 0):
        data = block_stream.read(length)
        if (hashlib.sha256(data).digest() == bhash):
            return data
        else:
            raise IOError('Block    hash    mismatch    error.')
    return bytes()
