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