Skip to content

Commit

Permalink
stop requiring channel and direction on sendonion since they're not…
Browse files Browse the repository at this point in the history
… used.

Changelog-Changed: `sendonion` no longer requires the gratuitous `direction` and `channel` fields in the `firsthop` parameter.
  • Loading branch information
fiatjaf authored Jun 4, 2021
1 parent fab1ed6 commit 2895325
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions doc/lightning-sendonion.7

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions doc/lightning-sendonion.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ to add an HTLC for 1002 millisatoshis and a delay of 21 blocks on top of the cur
```json
{
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
"direction": 1,
"amount_msat": "1002msat",
"delay": 21,
}
Expand Down Expand Up @@ -112,4 +111,3 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>

[bolt04]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md

4 changes: 2 additions & 2 deletions lightningd/pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ send_payment_core(struct lightningd *ld,
"peer found");

json_add_routefail_info(data, 0, WIRE_UNKNOWN_NEXT_PEER,
&ld->id, &first_hop->scid,
&ld->id, NULL,
node_id_idx(&ld->id,
&first_hop->node_id),
NULL);
Expand All @@ -1021,7 +1021,7 @@ send_payment_core(struct lightningd *ld,
if (failmsg) {
fail = immediate_routing_failure(cmd, ld,
fromwire_peektype(failmsg),
&first_hop->scid,
channel->scid,
&channel->peer->id);

return sendpay_fail(
Expand Down
2 changes: 0 additions & 2 deletions plugins/libplugin-pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,8 +1505,6 @@ static struct command_result *payment_createonion_success(struct command *cmd,
json_add_hex_talarr(req->js, "onion", p->createonion_response->onion);

json_object_start(req->js, "first_hop");
json_add_short_channel_id(req->js, "channel", &first->scid);
json_add_num(req->js, "direction", first->direction);
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);
Expand Down

0 comments on commit 2895325

Please sign in to comment.