From c4f28f9ed354fe98234e707d89712c3c50baf804 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 14 Dec 2024 08:12:11 +1030 Subject: [PATCH] lightningd: injectpaymentonion can use scids of unannounced channels. Cut & paste from the forwarding code, where we don't let onions use the unannounced scids. Obviously local commands can use them. Reported-by: @michael1011 Changelog-Fixed: JSON-RPC: xpay now works through unannounced channels. --- lightningd/pay.c | 2 +- tests/test_xpay.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lightningd/pay.c b/lightningd/pay.c index 972181bd376a..c53dedcd5980 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -1962,7 +1962,7 @@ static struct command_result *json_injectpaymentonion(struct command *cmd, if (payload->forward_channel) { next = any_channel_by_scid(cmd->ld, *payload->forward_channel, - false); + true); if (!next) return command_fail(cmd, JSONRPC2_INVALID_PARAMS, "Unknown scid %s", diff --git a/tests/test_xpay.py b/tests/test_xpay.py index 6879719e1fc6..0226d4069a94 100644 --- a/tests/test_xpay.py +++ b/tests/test_xpay.py @@ -523,7 +523,6 @@ def test_xpay_maxfee(node_factory, bitcoind, chainparams): assert fee <= maxfee -@pytest.mark.xfail(strict=True) def test_xpay_unannounced(node_factory): l1, l2 = node_factory.line_graph(2, announce_channels=False)