A route which looks good isn't actually, because of max htlc limits
(node_factory, bitcoind)
| 1493 | |
| 1494 | |
| 1495 | def test_max_htlc(node_factory, bitcoind): |
| 1496 | """A route which looks good isn't actually, because of max htlc limits""" |
| 1497 | gsfile, nodemap = generate_gossip_store([GenChannel(0, 1, capacity_sats=500_000, |
| 1498 | forward=GenChannel.Half(htlc_max=1_000_000)), |
| 1499 | GenChannel(0, 1, capacity_sats=20_000)]) |
| 1500 | l1 = node_factory.get_node(gossip_store_file=gsfile.name) |
| 1501 | |
| 1502 | routes = l1.rpc.getroutes(source=nodemap[0], |
| 1503 | destination=nodemap[1], |
| 1504 | amount_msat=20_000_000, |
| 1505 | layers=[], |
| 1506 | maxfee_msat=20_000_000, |
| 1507 | final_cltv=10) |
| 1508 | |
| 1509 | dir01 = direction(nodemap[0], nodemap[1]) |
| 1510 | check_route_as_expected(routes['routes'], |
| 1511 | [[{'short_channel_id_dir': f'0x1x0/{dir01}', 'amount_in_msat': 1_000_001, 'cltv_in': 10 + 6}], |
| 1512 | [{'short_channel_id_dir': f'1x1x1/{dir01}', 'amount_in_msat': 19_000_019, 'cltv_in': 10 + 6}]]) |
| 1513 | |
| 1514 | # If we can't use channel 2, we fail. |
| 1515 | l1.rpc.askrene_create_layer('removechan2') |
| 1516 | l1.rpc.askrene_inform_channel(layer='removechan2', |
| 1517 | short_channel_id_dir=f'1x1x1/{dir01}', |
| 1518 | amount_msat=1, |
| 1519 | inform='constrained') |
| 1520 | |
| 1521 | with pytest.raises(RpcError, match=rf"We could not find a usable set of paths. The shortest path is 0x1x0, but 0x1x0/{dir01} exceeds htlc_maximum_msat ~1000448msat"): |
| 1522 | l1.rpc.getroutes(source=nodemap[0], |
| 1523 | destination=nodemap[1], |
| 1524 | amount_msat=20_000_000, |
| 1525 | layers=['removechan2'], |
| 1526 | maxfee_msat=20_000_000, |
| 1527 | final_cltv=10) |
| 1528 | |
| 1529 | |
| 1530 | def test_min_htlc(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected