commit 2dd1cb86fa76d3ba5c3f0cdc4bd57a7ebf34d725
parent 63d2c3aaf41b36af651c1990b8747d18cb583ddb
Author: Janus <ysangkok@gmail.com>
Date: Mon, 9 Jul 2018 13:25:09 +0200
lnbase: do not revoke more than once if we have missed reading commitments
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/lnbase.py b/lib/lnbase.py
@@ -862,8 +862,9 @@ class Peer(PrintError):
if failure_coro.done():
sig_64, htlc_sigs = chan.sign_next_commitment()
self.send_message(gen_msg("commitment_signed", channel_id=chan.channel_id, signature=sig_64, num_htlcs=1, htlc_signature=htlc_sigs[0]))
+ self.revoke(chan)
while (await self.commitment_signed[chan.channel_id].get())["htlc_signature"] != b"":
- self.revoke(chan)
+ pass
# TODO process above commitment transactions
await self.receive_revoke(chan)
chan.fail_htlc(htlc)
@@ -880,12 +881,12 @@ class Peer(PrintError):
preimage = update_fulfill_htlc_msg["payment_preimage"]
chan.receive_htlc_settle(preimage, int.from_bytes(update_fulfill_htlc_msg["id"], "big"))
+ self.revoke(chan)
+
while (await self.commitment_signed[chan.channel_id].get())["htlc_signature"] != b"":
- self.revoke(chan)
+ pass
# TODO process above commitment transactions
- self.revoke(chan)
-
bare_ctx = chan.make_commitment(chan.remote_state.ctn + 1, False, chan.remote_state.next_per_commitment_point,
msat_remote, msat_local)