commit ff902a55eea5c02677042b34db9a0282e634235d
parent d5d9270d0c3d09972ec94fa90c016449a93077ea
Author: Janus <ysangkok@gmail.com>
Date: Wed, 19 Sep 2018 22:33:07 +0200
lnhtlc: don't settle htlc with HTLCStateMachine too early
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/electrum/lnbase.py b/electrum/lnbase.py
@@ -964,7 +964,6 @@ class Peer(PrintError):
await self.receive_revoke(chan)
- chan.settle_htlc(payment_preimage, htlc_id)
self.send_message(gen_msg("update_fulfill_htlc", channel_id=channel_id, id=htlc_id, payment_preimage=payment_preimage))
# remote commitment transaction without htlcs
@@ -984,6 +983,8 @@ class Peer(PrintError):
if commit_coro.done():
# this branch is taken with lnd after a fee update (initiated by us, of course)
+ await self.receive_commitment(chan, commit_coro.result())
+ chan.settle_htlc(payment_preimage, htlc_id)
await revoke_coro
process_revoke(revoke_coro.result())
self.revoke(chan)
@@ -994,6 +995,7 @@ class Peer(PrintError):
self.send_message(gen_msg("commitment_signed", channel_id=chan.channel_id, signature=sig_64, num_htlcs=len(htlc_sigs), htlc_signature=b"".join(htlc_sigs)))
await self.receive_revoke(chan)
elif revoke_coro.done():
+ chan.settle_htlc(payment_preimage, htlc_id)
process_revoke(revoke_coro.result())
await commit_coro