| 322 | } |
| 323 | |
| 324 | static struct command_result *maybe_add_path(struct command *cmd, |
| 325 | struct offer_info *offinfo) |
| 326 | { |
| 327 | const struct offers_data *od = get_offers_data(cmd->plugin); |
| 328 | |
| 329 | /* Populate paths assuming not already set by dev_paths */ |
| 330 | if (!offinfo->offer->offer_paths) { |
| 331 | /* BOLT #12: |
| 332 | * - if it is connected only by private channels: |
| 333 | * - MUST include `offer_paths` containing one or more paths to the node from |
| 334 | * publicly reachable nodes. |
| 335 | */ |
| 336 | if (we_want_blinded_path(cmd->plugin, offinfo->fronting_nodes, false)) { |
| 337 | /* We use *all* fronting nodes (not just "best" one) |
| 338 | * for offers */ |
| 339 | if (offinfo->fronting_nodes) { |
| 340 | offinfo->offer->offer_paths |
| 341 | = offer_onehop_paths(offinfo->offer, od, |
| 342 | offinfo->offer, |
| 343 | offinfo->fronting_nodes, |
| 344 | tal_count(offinfo->fronting_nodes)); |
| 345 | } else { |
| 346 | return find_best_peer(cmd, 1ULL << OPT_ONION_MESSAGES, |
| 347 | NULL, NULL, |
| 348 | found_best_peer, offinfo); |
| 349 | } |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | return create_offer(cmd, offinfo); |
| 354 | } |
| 355 | |
| 356 | static struct command_result *currency_done(struct command *cmd, |
| 357 | const char *method, |
no test coverage detected