Use SNV to verify that a name existed at a particular block ID in the past,
    given a later known-good block ID and consensus hash (as well as the previous
    untrusted consensus hash)

    Return the name's historic nameop(s) on success.
    If there are multiple matches, multiple nameops will be returned.
    The return value takes the form of {'status': True, 'nameops': [...]}
    Return a dict with {'error'} on error

def snv_name_verify(name, current_block_id, current_consensus_hash, block_id,
                    consensus_hash, trusted_txid=None, trusted_txindex=None, proxy=None):
    """
    Use SNV to verify that a name existed at a particular block ID in the past,
    given a later known-good block ID and consensus hash (as well as the previous
    untrusted consensus hash)

    Return the name's historic nameop(s) on success.
    If there are multiple matches, multiple nameops will be returned.
    The return value takes the form of {'status': True, 'nameops': [...]}
    Return a dict with {'error'} on error
    """

    proxy = get_default_proxy() if proxy is None else proxy

    historic_nameops = snv_get_blockstack_ops_at(
        current_block_id, current_consensus_hash,
        block_id, consensus_hash, proxy=proxy
    )

    if 'error' in historic_nameops:
        return historic_nameops

    matching_nameops = []

    # find the one we asked for
    for nameop in historic_nameops:
        # select on more-accurate filters first
        if trusted_txindex is not None and nameop['vtxindex'] == trusted_txindex:
            matching_nameops = [nameop]
            break

        if trusted_txid is not None and nameop['txid'] == trusted_txid:
            matching_nameops = [nameop]
            break

        if 'name' not in nameop:
            continue

        if str(nameop['name']) == str(name):
            # success!
            matching_nameops.append(nameop)
            continue

    if matching_nameops:
        return {'status': True, 'nameops': matching_nameops}

    # not found
    log.error('Not found at block {}: "{}"'.format(block_id, name))
    return {'error': 'Name not found'}