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.
This commit is contained in:
Rusty Russell
2024-12-14 08:12:11 +10:30
parent 92c45712d2
commit a2f58a28ba
2 changed files with 1 additions and 2 deletions

View File

@@ -1985,7 +1985,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",

View File

@@ -532,7 +532,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)