tlnpeer: send commitment after receiving updates - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 4228b926d4111c197ab9ce9a837f1426e5ae66f1 DIR parent 5f516bac357a68a882bc8b3319dd218afbc75341 HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 12 Feb 2019 11:26:38 +0100 lnpeer: send commitment after receiving updates Diffstat: M electrum/lnpeer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py t@@ -770,6 +770,7 @@ class Peer(PrintError): # process update_fail_htlc on channel chan = self.channels[channel_id] chan.receive_fail_htlc(htlc_id) + self.pending_updates[chan] = True local_ctn = chan.get_current_ctn(LOCAL) asyncio.ensure_future(self._on_update_fail_htlc(chan, htlc_id, local_ctn)) t@@ -833,6 +834,7 @@ class Peer(PrintError): await self._remote_changed_events[chan.channel_id].wait() async def await_local(self, chan: Channel, ctn: int): + self.maybe_send_commitment(chan) while chan.get_current_ctn(LOCAL) <= ctn: await self._local_changed_events[chan.channel_id].wait() t@@ -889,6 +891,7 @@ class Peer(PrintError): preimage = update_fulfill_htlc_msg["payment_preimage"] htlc_id = int.from_bytes(update_fulfill_htlc_msg["id"], "big") chan.receive_htlc_settle(preimage, htlc_id) + self.pending_updates[chan] = True local_ctn = chan.get_current_ctn(LOCAL) asyncio.ensure_future(self._on_update_fulfill_htlc(chan, htlc_id, preimage, local_ctn)) t@@ -1036,7 +1039,9 @@ class Peer(PrintError): def on_update_fee(self, payload): channel_id = payload["channel_id"] feerate =int.from_bytes(payload["feerate_per_kw"], "big") - self.channels[channel_id].update_fee(feerate, False) + chan = self.channels[channel_id] + chan.update_fee(feerate, False) + self.pending_updates[chan] = True async def bitcoin_fee_update(self, chan: Channel): """