| 747 | } |
| 748 | |
| 749 | static struct command_result *make_reply_path(struct command *cmd, |
| 750 | struct sending *sending) |
| 751 | { |
| 752 | struct out_req *req; |
| 753 | size_t nhops = tal_count(sending->sent->path); |
| 754 | |
| 755 | /* FIXME: Maybe we should allow this? */ |
| 756 | if (tal_count(sending->sent->path) == 1) |
| 757 | return command_fail(cmd, PAY_ROUTE_NOT_FOUND, |
| 758 | "Refusing to talk to ourselves"); |
| 759 | |
| 760 | req = jsonrpc_request_start(cmd->plugin, cmd, "blindedpath", |
| 761 | use_reply_path, |
| 762 | forward_error, |
| 763 | sending); |
| 764 | |
| 765 | /* FIXME: Could create an independent reply path, not just |
| 766 | * reverse existing. */ |
| 767 | json_array_start(req->js, "ids"); |
| 768 | for (int i = nhops - 2; i >= 0; i--) |
| 769 | json_add_pubkey(req->js, NULL, &sending->sent->path[i]); |
| 770 | json_array_end(req->js); |
| 771 | return send_outreq(cmd->plugin, req); |
| 772 | } |
| 773 | |
| 774 | static struct command_result *send_message(struct command *cmd, |
| 775 | struct sent *sent, |
no test coverage detected