async def reestablish_peers_and_channels(self):
    while True:
        (await asyncio.sleep(1))
        if self.stopping_soon:
            return
        for chan in self.channels.values():
            if chan.is_closed():
                continue
            if (not chan.should_try_to_reestablish_peer()):
                continue
            peer = self._peers.get(chan.node_id, None)
            if peer:
                (await peer.taskgroup.spawn(peer.reestablish_channel(chan)))
            else:
                (await self.taskgroup.spawn(self.reestablish_peer_for_given_channel(chan)))
async def reestablish_peers_and_channels(self):
    while True:
        (await asyncio.sleep(1))
        if self.stopping_soon:
            return
        for chan in self.channels.values():
            if chan.is_closed():
                continue
            if (not chan.should_try_to_reestablish_peer()):
                continue
            peer = self._peers.get(chan.node_id, None)
            if peer:
                (await peer.taskgroup.spawn(peer.reestablish_channel(chan)))
            else:
                (await self.taskgroup.spawn(self.reestablish_peer_for_given_channel(chan)))