tlightning: fix tests - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 242ab5ae563c433d528650a61bd3b1c50f7ddcb2 DIR parent 5fbadafdb1198cf19439b4fb9aaa92cfad87224d HTML Author: ThomasV <thomasv@electrum.org> Date: Mon, 8 Oct 2018 17:20:31 +0200 lightning: fix tests Diffstat: M electrum/lnhtlc.py | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) --- DIR diff --git a/electrum/lnhtlc.py b/electrum/lnhtlc.py t@@ -373,6 +373,8 @@ class HTLCStateMachine(PrintError): # TODO batch sweeps # TODO sweep HTLC outputs def process_new_offchain_ctx(self, ctx, ours: bool): + if not self.lnwatcher: + return outpoint = self.funding_outpoint.to_str() if ours: ctn = self.local_state.ctn + 1 t@@ -386,6 +388,8 @@ class HTLCStateMachine(PrintError): self.lnwatcher.add_sweep_tx(outpoint, ctx.txid(), encumbered_sweeptx) def process_new_revocation_secret(self, per_commitment_secret: bytes): + if not self.lnwatcher: + return outpoint = self.funding_outpoint.to_str() ctx = self.remote_commitment_to_be_revoked encumbered_sweeptx = maybe_create_sweeptx_for_their_ctx_to_local(self, ctx, per_commitment_secret, self.sweep_address)