@log_exceptions
async def _request_force_close_from_backup(self, channel_id: bytes):
    cb = self.channel_backups.get(channel_id)
    if (not cb):
        raise Exception(f'channel backup not found {self.channel_backups}')
    cb = cb.cb
    self.logger.info(f'requesting channel force close: {channel_id.hex()}')
    if isinstance(cb, ImportedChannelBackupStorage):
        node_id = cb.node_id
        privkey = cb.privkey
        addresses = [(cb.host, cb.port, 0)]
    else:
        assert isinstance(cb, OnchainChannelBackupStorage)
        if (not self.channel_db):
            raise Exception('Enable gossip first')
        node_id = self.network.channel_db.get_node_by_prefix(cb.node_id_prefix)
        privkey = self.node_keypair.privkey
        addresses = self.network.channel_db.get_node_addresses(node_id)
        if (not addresses):
            raise Exception('Peer not found in gossip database')
    for (host, port, timestamp) in addresses:
        peer_addr = LNPeerAddr(host, port, node_id)
        transport = LNTransport(privkey, peer_addr, proxy=self.network.proxy)
        peer = Peer(self, node_id, transport, is_channel_backup=True)
        try:
            async with TaskGroup(wait=any) as group:
                (await group.spawn(peer._message_loop()))
                (await group.spawn(peer.trigger_force_close(channel_id)))
            return
        except Exception as e:
            self.logger.info(f'failed to connect {host} {e}')
            continue
    else:
        raise Exception('failed to connect')
@log_exceptions
async def _request_force_close_from_backup(self, channel_id: bytes):
    cb = self.channel_backups.get(channel_id)
    if (not cb):
        raise Exception(f'channel backup not found {self.channel_backups}')
    cb = cb.cb
    self.logger.info(f'requesting channel force close: {channel_id.hex()}')
    if isinstance(cb, ImportedChannelBackupStorage):
        node_id = cb.node_id
        privkey = cb.privkey
        addresses = [(cb.host, cb.port, 0)]
    else:
        assert isinstance(cb, OnchainChannelBackupStorage)
        if (not self.channel_db):
            raise Exception('Enable gossip first')
        node_id = self.network.channel_db.get_node_by_prefix(cb.node_id_prefix)
        privkey = self.node_keypair.privkey
        addresses = self.network.channel_db.get_node_addresses(node_id)
        if (not addresses):
            raise Exception('Peer not found in gossip database')
    for (host, port, timestamp) in addresses:
        peer_addr = LNPeerAddr(host, port, node_id)
        transport = LNTransport(privkey, peer_addr, proxy=self.network.proxy)
        peer = Peer(self, node_id, transport, is_channel_backup=True)
        try:
            async with TaskGroup(wait=any) as group:
                (await group.spawn(peer._message_loop()))
                (await group.spawn(peer.trigger_force_close(channel_id)))
            return
        except Exception as e:
            self.logger.info(f'failed to connect {host} {e}')
            continue
    else:
        raise Exception('failed to connect')