mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
on_update_fail_htlc: don't send commitment without changes
c-lightning was force-closing channels with us: "[lnbase:127.0.0.1] error commit_sig with no changes"
This commit is contained in:
parent
bea5fd8ba8
commit
9578bfca12
1 changed files with 4 additions and 6 deletions
|
@ -985,20 +985,18 @@ class Peer(PrintError):
|
||||||
code = failure_msg.code
|
code = failure_msg.code
|
||||||
code_name = ONION_FAILURE_CODE_MAP.get(code, 'unknown_error!!')
|
code_name = ONION_FAILURE_CODE_MAP.get(code, 'unknown_error!!')
|
||||||
data = failure_msg.data
|
data = failure_msg.data
|
||||||
print("UPDATE_FAIL_HTLC", code_name, code, data)
|
self.print_error("UPDATE_FAIL_HTLC", code_name, code, data)
|
||||||
try:
|
try:
|
||||||
short_chan_id = route[sender_idx + 1].short_channel_id
|
short_chan_id = route[sender_idx + 1].short_channel_id
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print("payment destination reported error")
|
self.print_error("payment destination reported error")
|
||||||
else:
|
else:
|
||||||
# TODO this should depend on the error
|
# TODO this should depend on the error
|
||||||
# also, we need finer blacklisting (directed edges; nodes)
|
# also, we need finer blacklisting (directed edges; nodes)
|
||||||
self.network.path_finder.blacklist.add(short_chan_id)
|
self.network.path_finder.blacklist.add(short_chan_id)
|
||||||
|
|
||||||
print("HTLC failure with code {} ({})".format(code, code_name))
|
self.print_error("HTLC failure with code {} ({})".format(code, code_name))
|
||||||
chan = self.channels[channel_id]
|
chan = self.channels[channel_id]
|
||||||
self.send_commitment(chan)
|
|
||||||
await self.receive_revoke(chan)
|
|
||||||
chan.receive_fail_htlc(htlc_id)
|
chan.receive_fail_htlc(htlc_id)
|
||||||
await self.receive_commitment(chan)
|
await self.receive_commitment(chan)
|
||||||
self.revoke(chan)
|
self.revoke(chan)
|
||||||
|
|
Loading…
Add table
Reference in a new issue