| 237 | } |
| 238 | |
| 239 | struct command_result * |
| 240 | send_onion_reply(struct command *cmd, |
| 241 | struct blinded_path *reply_path, |
| 242 | struct tlv_onionmsg_tlv *payload) |
| 243 | { |
| 244 | const struct offers_data *od = get_offers_data(cmd->plugin); |
| 245 | struct onion_reply *onion_reply; |
| 246 | |
| 247 | onion_reply = tal(cmd, struct onion_reply); |
| 248 | onion_reply->reply_path = blinded_path_dup(onion_reply, reply_path); |
| 249 | onion_reply->payload = tal_steal(onion_reply, payload); |
| 250 | |
| 251 | if (!gossmap_scidd_pubkey(get_gossmap(cmd->plugin), |
| 252 | &onion_reply->reply_path->first_node_id)) { |
| 253 | plugin_log(cmd->plugin, LOG_DBG, |
| 254 | "Cannot resolve initial reply scidd %s", |
| 255 | fmt_short_channel_id_dir(tmpctx, |
| 256 | &onion_reply->reply_path->first_node_id.scidd)); |
| 257 | return command_hook_success(cmd); |
| 258 | } |
| 259 | |
| 260 | return establish_onion_path(cmd, get_gossmap(cmd->plugin), |
| 261 | &od->id, &onion_reply->reply_path->first_node_id.pubkey, |
| 262 | od->disable_connect, |
| 263 | send_onion_reply_after_established, |
| 264 | send_onion_reply_not_established, |
| 265 | onion_reply); |
| 266 | } |
| 267 | |
| 268 | static struct command_result *onion_message_recv(struct command *cmd, |
| 269 | const char *buf, |
no test coverage detected