pay: specify the channel to send the first hop.

If we only specify the node_id, we get the "first" channel.

Closes: #5803
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: `pay` uses the correct local channel for payments when there are multiple available (not just always the first!)
This commit is contained in:
Rusty Russell
2023-02-02 12:19:17 +10:30
parent ec8aab7cb2
commit 9e9686df20
2 changed files with 1 additions and 1 deletions

View File

@@ -1573,6 +1573,7 @@ static struct command_result *payment_createonion_success(struct command *cmd,
json_add_amount_msat_only(req->js, "amount_msat", first->amount);
json_add_num(req->js, "delay", first->delay);
json_add_node_id(req->js, "id", &first->node_id);
json_add_short_channel_id(req->js, "channel", &first->scid);
json_object_end(req->js);
json_add_sha256(req->js, "payment_hash", p->payment_hash);

View File

@@ -5305,7 +5305,6 @@ def test_payerkey(node_factory):
assert n.rpc.decode(b12)['invreq_payer_id'] == k
@pytest.mark.xfail(strict=True)
def test_cln_sendpay_weirdness(bitcoind, node_factory):
# 0. Setup