def start_network(self, network: 'Network'):
    assert network
    self.network = network
    self.config = network.config
    self.lnwatcher = LNWalletWatcher(self, network)
    self.lnwatcher.start_network(network)
    self.swap_manager.start_network(network=network, lnwatcher=self.lnwatcher)
    self.lnrater = LNRater(self, network)
    for chan in self.channels.values():
        self.lnwatcher.add_channel(chan.funding_outpoint.to_str(), chan.get_funding_address())
    for cb in self.channel_backups.values():
        self.lnwatcher.add_channel(cb.funding_outpoint.to_str(), cb.get_funding_address())
    for coro in [self.maybe_listen(), self.lnwatcher.on_network_update('network_updated'), self.reestablish_peers_and_channels(), self.sync_with_local_watchtower(), self.sync_with_remote_watchtower()]:
        tg_coro = self.taskgroup.spawn(coro)
        asyncio.run_coroutine_threadsafe(tg_coro, self.network.asyncio_loop)
def start_network(self, network: 'Network'):
    assert network
    self.network = network
    self.config = network.config
    self.lnwatcher = LNWalletWatcher(self, network)
    self.lnwatcher.start_network(network)
    self.swap_manager.start_network(network=network, lnwatcher=self.lnwatcher)
    self.lnrater = LNRater(self, network)
    for chan in self.channels.values():
        self.lnwatcher.add_channel(chan.funding_outpoint.to_str(), chan.get_funding_address())
    for cb in self.channel_backups.values():
        self.lnwatcher.add_channel(cb.funding_outpoint.to_str(), cb.get_funding_address())
    for coro in [self.maybe_listen(), self.lnwatcher.on_network_update('network_updated'), self.reestablish_peers_and_channels(), self.sync_with_local_watchtower(), self.sync_with_remote_watchtower()]:
        tg_coro = self.taskgroup.spawn(coro)
        asyncio.run_coroutine_threadsafe(tg_coro, self.network.asyncio_loop)