From c478f3bb91371204c9015fb7160a9c26ca15607e Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 27 Dec 2020 18:11:34 +0100 Subject: [PATCH] channel backups: fix exception in raised after channel is force closed Traceback (most recent call last): File "/opt/electrum/electrum/util.py", line 1056, in wrapper return await func(*args, **kwargs) File "/opt/electrum/electrum/lnwatcher.py", line 183, in on_network_update await callback() File "/opt/electrum/electrum/lnwatcher.py", line 200, in check_onchain_situation keep_watching = await self.do_breach_remedy(funding_outpoint, closing_tx, spenders) File "/opt/electrum/electrum/lnwatcher.py", line 377, in do_breach_remedy sweep_info_dict = chan.sweep_ctx(closing_tx) File "/opt/electrum/electrum/lnchannel.py", line 227, in sweep_ctx our_sweep_info = self.create_sweeptxs_for_our_ctx(ctx) File "/opt/electrum/electrum/lnchannel.py", line 216, in create_sweeptxs_for_our_ctx return create_sweeptxs_for_our_ctx(chan=self, ctx=ctx, sweep_address=self.sweep_address) File "/opt/electrum/electrum/lnchannel.py", line 321, in sweep_address assert self.lnworker.wallet.is_mine(addr) AssertionError --- electrum/lnchannel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py index 6a97910c8..9930d74a8 100644 --- a/electrum/lnchannel.py +++ b/electrum/lnchannel.py @@ -491,7 +491,11 @@ class ChannelBackup(AbstractChannel): return False def is_static_remotekey_enabled(self) -> bool: - return True + # Return False so that self.sweep_address will return self._fallback_sweep_address + # Since channel backups do not save the static_remotekey, payment_basepoint in + # their local config is not static) + return False + class Channel(AbstractChannel):