MCPcopy Create free account
hub / github.com/ElementsProject/lightning / make_reply_path

Function make_reply_path

plugins/fetchinvoice.c:749–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

747}
748
749static 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
774static struct command_result *send_message(struct command *cmd,
775 struct sent *sent,

Callers 1

send_messageFunction · 0.85

Calls 5

json_add_pubkeyFunction · 0.85
command_failFunction · 0.70
send_outreqFunction · 0.70
json_array_startFunction · 0.50
json_array_endFunction · 0.50

Tested by

no test coverage detected