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

Function establish_path_fail

plugins/fetchinvoice.c:609–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607 struct establishing_paths *epaths);
608
609static struct command_result *establish_path_fail(struct command *cmd,
610 const char *why,
611 struct establishing_paths *epaths)
612{
613 const struct blinded_path *bpath = current_their_path(epaths);
614
615 /* No blinded paths? We fail to establish connection directly */
616 if (epaths->sent->direct_dest) {
617 return command_fail(cmd, OFFER_ROUTE_NOT_FOUND,
618 "Failed: could not route or connect directly to %s: %s",
619 fmt_pubkey(tmpctx, epaths->sent->direct_dest), why);
620 }
621
622 plugin_log(cmd->plugin, LOG_DBG, "establish path to %s failed: %s",
623 fmt_sciddir_or_pubkey(tmpctx, &bpath->first_node_id), why);
624 if (epaths->which_blinded_path == tal_count(epaths->sent->their_paths) - 1) {
625 return command_fail(cmd, OFFER_ROUTE_NOT_FOUND,
626 "Failed: could not route or connect directly to blinded path at %s: %s",
627 fmt_sciddir_or_pubkey(tmpctx, &bpath->first_node_id),
628 why);
629 }
630
631 /* Try the next one */
632 epaths->which_blinded_path++;
633 return try_establish(cmd, epaths);
634}
635
636static struct command_result *try_establish(struct command *cmd,
637 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