diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index f2710db52..611b5ba26 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -286,7 +286,8 @@ static void connect_failed(struct lightningd *ld, * does simply combine those, so we don't get a response per request, and it's a * very rare corner case (which, unlike the above, doesn't happen in CI!). */ - if (strstarts(connect_reason, "connect command")) { + if (strstarts(connect_reason, "connect command") + || errcode == CONNECT_DISCONNECTED_DURING) { /* We can have multiple connect commands: fail them all */ while ((c = find_connect(ld, id)) != NULL) { /* They delete themselves from list */ diff --git a/tests/test_pay.py b/tests/test_pay.py index 94ee2c0a4..1b35d5094 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -3480,7 +3480,6 @@ def test_reject_invalid_payload(node_factory): l2.daemon.wait_for_log(r'Failing HTLC because of an invalid payload') -@unittest.skip("Test is flaky causing CI to be unusable.") def test_excluded_adjacent_routehint(node_factory, bitcoind): """Test case where we try have a routehint which leads to an adjacent node, but the result exceeds our maxfee; we crashed trying to find @@ -3489,10 +3488,15 @@ def test_excluded_adjacent_routehint(node_factory, bitcoind): """ l1, l2, l3 = node_factory.line_graph(3) + # Make sure l2->l3 is usable. + wait_for(lambda: 'remote' in only_one(l3.rpc.listpeerchannels()['channels'])['updates']) + # We'll be forced to use routehint, since we don't know about l3. inv = l3.rpc.invoice(10**3, "lbl", "desc", exposeprivatechannels=l2.get_channel_scid(l3)) - l1.wait_channel_active(l1.get_channel_scid(l2)) + # Make sure l1->l2 is usable. + wait_for(lambda: 'remote' in only_one(l1.rpc.listpeerchannels()['channels'])['updates']) + # This will make it reject the routehint. err = r'Fee exceeds our fee budget: 1msat > 0msat, discarding route' with pytest.raises(RpcError, match=err):