| 566 | struct establishing_paths *epaths); |
| 567 | |
| 568 | static 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 | |
| 595 | static struct command_result *try_establish(struct command *cmd, |
| 596 | struct establishing_paths *epaths) |
no test coverage detected