From 788d54f9a67d819a69e9e80186a45322b5559b55 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 9 Oct 2019 19:54:43 +0200 Subject: [PATCH] remove another instance of lnworker accessed in lnchannel --- electrum/lnchannel.py | 2 -- electrum/lnpeer.py | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py index 0b69e93c1..9596ce684 100644 --- a/electrum/lnchannel.py +++ b/electrum/lnchannel.py @@ -572,8 +572,6 @@ class Channel(Logger): assert htlc.payment_hash == sha256(preimage) assert htlc_id not in log['settles'] self.hm.send_settle(htlc_id) - if self.lnworker: - self.lnworker.set_invoice_status(htlc.payment_hash, PR_PAID) def receive_htlc_settle(self, preimage, htlc_id): self.logger.info("receive_htlc_settle") diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index fb4f6161a..3db7b80b6 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -1442,6 +1442,8 @@ class Peer(Logger): async def _fulfill_htlc(self, chan: Channel, htlc_id: int, preimage: bytes): self.logger.info(f"_fulfill_htlc. chan {chan.short_channel_id}. htlc_id {htlc_id}") chan.settle_htlc(preimage, htlc_id) + payment_hash = sha256(preimage) + self.lnworker.set_invoice_status(payment_hash, PR_PAID) remote_ctn = chan.get_latest_ctn(REMOTE) self.send_message("update_fulfill_htlc", channel_id=chan.channel_id,