Skip to content

Commit

Permalink
pytest: test that we can pay via routehints even if a 1000-min-htlc c…
Browse files Browse the repository at this point in the history
…hannel is in path.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Aug 18, 2023
1 parent f4e2d9a commit 2c3f8b8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -5387,3 +5387,31 @@ def test_listsendpays_crash(node_factory):

inv = l1.rpc.invoice(40, "inv", "inv")["bolt11"]
l1.rpc.listsendpays('lightning:' + inv)


@pytest.mark.xfail(strict=True)
@pytest.mark.developer("updates are delayed without --dev-fast-gossip")
def test_pay_routehint_minhtlc(node_factory, bitcoind):
# l1 -> l2 -> l3 private -> l4
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
l4 = node_factory.get_node()

l3.fundchannel(l4, announce_channel=False)

# l2->l3 required htlc of at least 1sat
scid = only_one(l2.rpc.setchannel(l3.info['id'], htlcmin=1000)['channels'])['short_channel_id']

# Make sure l4 knows about l1
wait_for(lambda: l4.rpc.listnodes(l1.info['id'])['nodes'] != [])

# And make sure l1 knows that l2->l3 has htlcmin 1000
wait_for(lambda: l1.rpc.listchannels(scid)['channels'][0]['htlc_minimum_msat'] == Millisatoshi(1000))

inv = l4.rpc.invoice(100000, "inv", "inv")
assert only_one(l1.rpc.decodepay(inv['bolt11'])['routes'])

# You should be able to pay the invoice!
l1.rpc.pay(inv['bolt11'])

# And you should also be able to getroute (and have it ignore htlc_min/max constraints!)
l1.rpc.getroute(l3.info['id'], amount_msat=0, riskfactor=1)

0 comments on commit 2c3f8b8

Please sign in to comment.