From 29266fd6834b348e0171c8a336c7eeaa2252ad7d Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Tue, 19 Nov 2024 22:40:48 +0100 Subject: [PATCH] tests: add pay test over unannounced channels This test fails with cln v24.08.2. Add this test, so it doesn't happen again. Changelog-None --- tests/test_pay.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_pay.py b/tests/test_pay.py index 42a98f9e39b4..cfe3fb522c52 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -6702,3 +6702,18 @@ def get_local_channel_by_id(node, chanid): receipt = only_one(l3.rpc.listinvoices("inv")["invoices"]) assert receipt["status"] == "paid" assert receipt["amount_received_msat"] == total_msat + +def test_pay_unannounced_routehint(node_factory, bitcoind): + """Tests whether sender can pay recipient through unannounced channels with + 2 hops where the second hop uses a route hint.""" + l1, l2, l3, r1 = node_factory.get_nodes(4) + + # l1 and l3 are connected with unannounced channels to l2 + node_factory.join_nodes([l1, l2], announce_channels=False) + node_factory.join_nodes([l2, l3], announce_channels=False) + + # Need this to ensure l3 adds a route hint in the invoice + node_factory.join_nodes([l2, r1], wait_for_announce=True) + + invoice = l3.rpc.invoice(2100000, 'receive', 'receive') + l1.rpc.pay(invoice['bolt11'])