commit ce88b36e81a533810b08ccf8796120951265da8a
parent 652d10aa5f810d6db00ce4870ea7c779f9ff35a4
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 9 Mar 2021 12:28:25 +0100
lnworker: simplify request_force_close_from_backup
Diffstat:
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/electrum/lnworker.py b/electrum/lnworker.py
@@ -1990,11 +1990,5 @@ class LNWallet(LNWorker):
async def request_force_close_from_backup(self, channel_id: bytes):
cb = self.channel_backups[channel_id].cb
# TODO also try network addresses from gossip db (as it might have changed)
- peer_addr = LNPeerAddr(cb.host, cb.port, cb.node_id)
- transport = LNTransport(cb.privkey, peer_addr,
- proxy=self.network.proxy)
- peer = Peer(self, cb.node_id, transport, is_channel_backup=True)
- async with TaskGroup() as group:
- await group.spawn(peer._message_loop())
- await group.spawn(peer.trigger_force_close(channel_id))
- # TODO force-exit taskgroup, to clean-up
+ peer = await self._add_peer(cb.host, cb.port, cb.node_id)
+ await peer.trigger_force_close(channel_id)