@ignore_exceptions
@log_exceptions
async def reestablish_peer_for_given_channel(self, chan: Channel) -> None:
    now = time.time()
    peer_addresses = []
    if (not self.channel_db):
        addr = trampolines_by_id().get(chan.node_id)
        if addr:
            peer_addresses.append(addr)
    else:
        last_good_addr = self.channel_db.get_last_good_address(chan.node_id)
        if last_good_addr:
            peer_addresses.append(last_good_addr)
        addrs_from_gossip = (self.channel_db.get_node_addresses(chan.node_id) or [])
        for (host, port, ts) in addrs_from_gossip:
            peer_addresses.append(LNPeerAddr(host, port, chan.node_id))
    peer_addresses += list(chan.get_peer_addresses())
    for peer in peer_addresses:
        if self._can_retry_addr(peer, urgent=True, now=now):
            (await self._add_peer(peer.host, peer.port, peer.pubkey))
            return
@ignore_exceptions
@log_exceptions
async def reestablish_peer_for_given_channel(self, chan: Channel) -> None:
    now = time.time()
    peer_addresses = []
    if (not self.channel_db):
        addr = trampolines_by_id().get(chan.node_id)
        if addr:
            peer_addresses.append(addr)
    else:
        last_good_addr = self.channel_db.get_last_good_address(chan.node_id)
        if last_good_addr:
            peer_addresses.append(last_good_addr)
        addrs_from_gossip = (self.channel_db.get_node_addresses(chan.node_id) or [])
        for (host, port, ts) in addrs_from_gossip:
            peer_addresses.append(LNPeerAddr(host, port, chan.node_id))
    peer_addresses += list(chan.get_peer_addresses())
    for peer in peer_addresses:
        if self._can_retry_addr(peer, urgent=True, now=now):
            (await self._add_peer(peer.host, peer.port, peer.pubkey))
            return