mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-02 18:25:21 +00:00
lnhtlc: don't settle htlc with HTLCStateMachine too early
This commit is contained in:
parent
d5d9270d0c
commit
ff902a55ee
1 changed files with 3 additions and 1 deletions
|
@ -964,7 +964,6 @@ class Peer(PrintError):
|
||||||
|
|
||||||
await self.receive_revoke(chan)
|
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))
|
self.send_message(gen_msg("update_fulfill_htlc", channel_id=channel_id, id=htlc_id, payment_preimage=payment_preimage))
|
||||||
|
|
||||||
# remote commitment transaction without htlcs
|
# remote commitment transaction without htlcs
|
||||||
|
@ -984,6 +983,8 @@ class Peer(PrintError):
|
||||||
|
|
||||||
if commit_coro.done():
|
if commit_coro.done():
|
||||||
# this branch is taken with lnd after a fee update (initiated by us, of course)
|
# 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
|
await revoke_coro
|
||||||
process_revoke(revoke_coro.result())
|
process_revoke(revoke_coro.result())
|
||||||
self.revoke(chan)
|
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)))
|
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)
|
await self.receive_revoke(chan)
|
||||||
elif revoke_coro.done():
|
elif revoke_coro.done():
|
||||||
|
chan.settle_htlc(payment_preimage, htlc_id)
|
||||||
process_revoke(revoke_coro.result())
|
process_revoke(revoke_coro.result())
|
||||||
|
|
||||||
await commit_coro
|
await commit_coro
|
||||||
|
|
Loading…
Add table
Reference in a new issue