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

Function use_reply_path

plugins/fetchinvoice.c:726–747  ·  view source on GitHub ↗

Lightningd gives us reply path, since we don't know secret to put * in final so it will recognize it. */

Source from the content-addressed store, hash-verified

724/* Lightningd gives us reply path, since we don't know secret to put
725 * in final so it will recognize it. */
726static struct command_result *use_reply_path(struct command *cmd,
727 const char *buf,
728 const jsmntok_t *result,
729 struct sending *sending)
730{
731 struct tlv_onionmsg_payload_reply_path *rpath;
732
733 rpath = json_to_reply_path(cmd, buf,
734 json_get_member(buf, result, "blindedpath"));
735 if (!rpath)
736 plugin_err(cmd->plugin,
737 "could not parse reply path %.*s?",
738 json_tok_full_len(result),
739 json_tok_full(buf, result));
740
741 /* Remember our alias we used so we can recognize reply */
742 sending->sent->reply_alias
743 = tal_dup(sending->sent, struct pubkey,
744 &rpath->path[tal_count(rpath->path)-1]->node_id);
745
746 return send_modern_message(cmd, rpath, sending);
747}
748
749static struct command_result *make_reply_path(struct command *cmd,
750 struct sending *sending)

Callers

nothing calls this directly

Calls 6

json_to_reply_pathFunction · 0.85
send_modern_messageFunction · 0.85
plugin_errFunction · 0.70
json_get_memberFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected