commit 51466930f28e0b1fa547a23a01306f777f5377e0 parent 38f1436d789af4189dbd4316f33c465eddaf07ec Author: ThomasV <thomasv@electrum.org> Date: Thu, 7 Mar 2019 10:25:39 +0100 reestablish_peers_and_channels: spawn tasks in for loop Diffstat:
M | electrum/lnworker.py | | | 7 | ++----- |
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/electrum/lnworker.py b/electrum/lnworker.py @@ -797,11 +797,8 @@ class LNWorker(PrintError): if not chan.should_try_to_reestablish_peer(): continue peer = self.peers.get(chan.node_id, None) - if peer is None: - await reestablish_peer_for_given_channel() - else: - coro = peer.reestablish_channel(chan) - asyncio.run_coroutine_threadsafe(coro, self.network.asyncio_loop) + coro = peer.reestablish_channel(chan) if peer else reestablish_peer_for_given_channel() + await self.network.main_taskgroup.spawn(coro) def current_feerate_per_kw(self): from .simple_config import FEE_LN_ETA_TARGET, FEERATE_FALLBACK_STATIC_FEE, FEERATE_REGTEST_HARDCODED