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

Function establish_path_fail

plugins/fetchinvoice.c:568–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566 struct establishing_paths *epaths);
567
568static struct command_result *establish_path_fail(struct command *cmd,
569 const char *why,
570 struct establishing_paths *epaths)
571{
572 const struct blinded_path *bpath = current_their_path(epaths);
573
574 /* No blinded paths? We fail to establish connection directly */
575 if (epaths->sent->direct_dest) {
576 return command_fail(cmd, OFFER_ROUTE_NOT_FOUND,
577 "Failed: could not route or connect directly to %s: %s",
578 fmt_pubkey(tmpctx, epaths->sent->direct_dest), why);
579 }
580
581 plugin_log(cmd->plugin, LOG_DBG, "establish path to %s failed: %s",
582 fmt_sciddir_or_pubkey(tmpctx, &bpath->first_node_id), why);
583 if (epaths->which_blinded_path == tal_count(epaths->sent->their_paths) - 1) {
584 return command_fail(cmd, OFFER_ROUTE_NOT_FOUND,
585 "Failed: could not route or connect directly to blinded path at %s: %s",
586 fmt_sciddir_or_pubkey(tmpctx, &bpath->first_node_id),
587 why);
588 }
589
590 /* Try the next one */
591 epaths->which_blinded_path++;
592 return try_establish(cmd, epaths);
593}
594
595static struct command_result *try_establish(struct command *cmd,
596 struct establishing_paths *epaths)

Callers 1

try_establishFunction · 0.85

Calls 6

current_their_pathFunction · 0.85
fmt_pubkeyFunction · 0.85
fmt_sciddir_or_pubkeyFunction · 0.85
try_establishFunction · 0.85
command_failFunction · 0.70
plugin_logFunction · 0.70

Tested by

no test coverage detected