| 607 | struct establishing_paths *epaths); |
| 608 | |
| 609 | static 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 | |
| 636 | static struct command_result *try_establish(struct command *cmd, |
| 637 | struct establishing_paths *epaths) |
no test coverage detected