Skip to content

Commit

Permalink
lightningd: injectpaymentonion can use scids of unannounced channels.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rustyrussell committed Dec 13, 2024
1 parent 205ba00 commit c4f28f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion lightningd/pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion tests/test_xpay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c4f28f9

Please sign in to comment.