Browse Source

remove another instance of lnworker accessed in lnchannel

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
ThomasV 5 years ago
parent
commit
788d54f9a6
  1. 2
      electrum/lnchannel.py
  2. 2
      electrum/lnpeer.py

2
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")

2
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,

Loading…
Cancel
Save