electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 7ae82c82300c0a08e1a5ba023c439566aba6109f
parent abc155b6887afea4cc082328f86a09c668523214
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 10 Mar 2021 12:54:00 +0100

Revert "lnworker: simplify request_force_close_from_backup"

This reverts commit ce88b36e81a533810b08ccf8796120951265da8a.

Diffstat:
Melectrum/lnworker.py | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/electrum/lnworker.py b/electrum/lnworker.py @@ -1990,5 +1990,11 @@ 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 = await self._add_peer(cb.host, cb.port, cb.node_id) - await peer.trigger_force_close(channel_id) + 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