def get_input_addrs(tx):
    """ Takes tx object and returns the input addresses associated. """
    addrs = []
    # print("tx['inputs']: ", tx['inputs'])
    for x in tx['inputs']:
        try:
            addrs.append(x['prev_out']['addr'])
        except KeyError:
            continue
    return addrs

    #try:
    #    return [x['prev_out']['addr'] for x in tx['inputs']]
    #except KeyError:
        # This happens when there's a coinbase transaction
    #    return []