diff --git a/plugins/pay.c b/plugins/pay.c index f7c9595a47a2..3acafcf219d6 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1881,9 +1881,25 @@ struct payment_modifier *paymod_mods[] = { &local_channel_hints_pay_mod, &exemptfee_pay_mod, &directpay_pay_mod, - &presplit_pay_mod, &shadowroute_pay_mod, + /* NOTE: The order in which these two paymods are executed is + * significant! + * routehints *must* execute first before presplit. + * + * FIXME: Giving an ordered list of paymods to the paymod + * system is the wrong interface, given that the order in + * which paymods execute is significant. + * (This is typical of Entity-Component-System pattern.) + * What should be done is that libplugin-pay should have a + * canonical list of paymods in the order they execute + * correctly, and whether they are default-enabled/default-disabled, + * and then clients like `pay` and `keysend` will disable/enable + * paymods that do not help them, instead of the current interface + * where clients provide an *ordered* list of paymods they want to + * use. + */ &routehints_pay_mod, + &presplit_pay_mod, &waitblockheight_pay_mod, &retry_pay_mod, &adaptive_splitter_pay_mod, diff --git a/tests/test_pay.py b/tests/test_pay.py index 3dca2ac3d7a8..5baeeb1eb234 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -3223,10 +3223,9 @@ def test_bolt11_null_after_pay(node_factory, bitcoind): assert('amount_msat' in pays[0] and pays[0]['amount_msat'] == amt) -@pytest.mark.xfail(strict=True) def test_mpp_presplit_routehint_conflict(node_factory, bitcoind): ''' - We have a bug where pre-splitting the payment prevents *any* + We had a bug where pre-splitting the payment prevents *any* routehints from being taken. We tickle that bug here by building l1->l2->l3, but with l2->l3 as an unpublished channel.