'convert pubkeys to addresses'

def get_outputs(self):

    o = []
    for (type, x, v) in self.outputs():
        if (type == TYPE_ADDRESS):
            addr = x
        elif (type == TYPE_PUBKEY):
            addr = bitcoin.public_key_to_p2pkh(x.decode('hex'))
        else:
            addr = ('SCRIPT    ' + x.encode('hex'))
        o.append((addr, v))
    return o
