Skip to content

Commit

Permalink
tests: add pay test over unannounced channels
Browse files Browse the repository at this point in the history
This test fails with cln v24.08.2. Add this test, so it doesn't happen
again.

Changelog-None
  • Loading branch information
JssDWt committed Nov 19, 2024
1 parent 1b2d5ac commit 29266fd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

0 comments on commit 29266fd

Please sign in to comment.