lightningd: attach HTLC timeout to htlc itself, fix gratuitous disconnect bug.

We set the timeout on first HTLC, but didn't clear it if that HTLC failed.

It's saner to have a per-HTLC timeout (since that's what it is!) and
also our timer infra is specially coded to scale approximately infinitely so
trying to optimize this is vastly premature.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Protocol: We would sometimes gratuitously disconnect 30 seconds after an HTLC failed.
This commit is contained in:
Rusty Russell
2021-05-21 11:45:54 +09:30
parent 11180e7aa1
commit 33736b860a
7 changed files with 22 additions and 19 deletions

View File

@@ -3286,7 +3286,6 @@ def test_openchannel_init_alternate(node_factory, executor):
fut.result(10)
@pytest.mark.xfail(strict=True)
def test_htlc_failed_noclose(node_factory):
"""Test a bug where the htlc timeout would kick in even if the HTLC failed"""
l1, l2 = node_factory.line_graph(2)