Lightningd gives us reply path, since we don't know secret to put * in final so it will recognize it. */
| 724 | /* Lightningd gives us reply path, since we don't know secret to put |
| 725 | * in final so it will recognize it. */ |
| 726 | static struct command_result *use_reply_path(struct command *cmd, |
| 727 | const char *buf, |
| 728 | const jsmntok_t *result, |
| 729 | struct sending *sending) |
| 730 | { |
| 731 | struct tlv_onionmsg_payload_reply_path *rpath; |
| 732 | |
| 733 | rpath = json_to_reply_path(cmd, buf, |
| 734 | json_get_member(buf, result, "blindedpath")); |
| 735 | if (!rpath) |
| 736 | plugin_err(cmd->plugin, |
| 737 | "could not parse reply path %.*s?", |
| 738 | json_tok_full_len(result), |
| 739 | json_tok_full(buf, result)); |
| 740 | |
| 741 | /* Remember our alias we used so we can recognize reply */ |
| 742 | sending->sent->reply_alias |
| 743 | = tal_dup(sending->sent, struct pubkey, |
| 744 | &rpath->path[tal_count(rpath->path)-1]->node_id); |
| 745 | |
| 746 | return send_modern_message(cmd, rpath, sending); |
| 747 | } |
| 748 | |
| 749 | static struct command_result *make_reply_path(struct command *cmd, |
| 750 | struct sending *sending) |
nothing calls this directly
no test coverage detected