def find_vout_for_address_from_txobj(tx_obj, addr):
    """
    Locate the vout index of the given transaction sending to the
    given address. Raises runtime error exception if not found.
    """
    for i in range(len(tx_obj["vout"])):
        if any([addr == a for a in tx_obj["vout"][i]["scriptPubKey"]["addresses"]]):
            return i
    raise RuntimeError("Vout not found for address: txid={}, addr={}".format(tx_obj['txid'], addr))