Skip to content

Commit a473217

Browse files
rustyrussellendothermicdev
authored andcommitted
pytest: test for forwarding legacy onion.
This fails, because l2 can't decode the onion: ``` lightningd-2 2024-05-28T21:43:35.137Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#1: Rejecting their htlc 0 since onion is unprocessable WIRE_INVALID_ONION_HMAC ss=4202c24ea44d9029a2ea3abb24cded51da93164f8bb5cddce9cc824af9945435 ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent 288c474 commit a473217

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test_pay.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5660,3 +5660,32 @@ def test_pay_while_opening_channel(node_factory, bitcoind, executor):
56605660
assert only_one(l1.rpc.listpeerchannels(l3.info['id'])['channels'])['state'] == 'OPENINGD'
56615661
inv = l2.rpc.invoice(10000, "inv", "inv")
56625662
l1.rpc.pay(inv['bolt11'])
5663+
5664+
5665+
@pytest.mark.xfail(strict=True)
5666+
def test_pay_legacy_forward(node_factory, bitcoind, executor):
5667+
"""We removed legacy in 22.11, and LND will still send them for
5668+
route hints! See
5669+
https://github.com/lightningnetwork/lnd/issues/8785
5670+
5671+
"""
5672+
l1, l2, l3 = node_factory.line_graph(3, fundamount=10**6, wait_for_announce=True)
5673+
5674+
inv = l3.rpc.invoice(1000, "inv", "inv")
5675+
5676+
chanid12 = only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['short_channel_id']
5677+
chanid23 = only_one(l2.rpc.listpeerchannels(l3.info['id'])['channels'])['short_channel_id']
5678+
route = [{'amount_msat': 1011,
5679+
'id': l2.info['id'],
5680+
'delay': 20,
5681+
'channel': chanid12},
5682+
{'amount_msat': 1000,
5683+
'id': l3.info['id'],
5684+
'delay': 10,
5685+
'channel': chanid23}]
5686+
5687+
l1.rpc.call("sendpay", payload={'route': route,
5688+
'payment_hash': inv['payment_hash'],
5689+
'payment_secret': inv['payment_secret'],
5690+
'dev_legacy_hop': True})
5691+
l1.rpc.waitsendpay(inv['payment_hash'])

0 commit comments

Comments
 (0)