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

Function send_onion_reply

plugins/offers.c:239–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239struct command_result *
240send_onion_reply(struct command *cmd,
241 struct blinded_path *reply_path,
242 struct tlv_onionmsg_tlv *payload)
243{
244 const struct offers_data *od = get_offers_data(cmd->plugin);
245 struct onion_reply *onion_reply;
246
247 onion_reply = tal(cmd, struct onion_reply);
248 onion_reply->reply_path = blinded_path_dup(onion_reply, reply_path);
249 onion_reply->payload = tal_steal(onion_reply, payload);
250
251 if (!gossmap_scidd_pubkey(get_gossmap(cmd->plugin),
252 &onion_reply->reply_path->first_node_id)) {
253 plugin_log(cmd->plugin, LOG_DBG,
254 "Cannot resolve initial reply scidd %s",
255 fmt_short_channel_id_dir(tmpctx,
256 &onion_reply->reply_path->first_node_id.scidd));
257 return command_hook_success(cmd);
258 }
259
260 return establish_onion_path(cmd, get_gossmap(cmd->plugin),
261 &od->id, &onion_reply->reply_path->first_node_id.pubkey,
262 od->disable_connect,
263 send_onion_reply_after_established,
264 send_onion_reply_not_established,
265 onion_reply);
266}
267
268static struct command_result *onion_message_recv(struct command *cmd,
269 const char *buf,

Callers 3

fail_invreq_levelFunction · 0.85
createinvoice_doneFunction · 0.85
fail_inv_levelFunction · 0.85

Calls 7

get_offers_dataFunction · 0.85
blinded_path_dupFunction · 0.85
gossmap_scidd_pubkeyFunction · 0.85
fmt_short_channel_id_dirFunction · 0.85
get_gossmapFunction · 0.70
plugin_logFunction · 0.70
command_hook_successFunction · 0.70

Tested by

no test coverage detected