| 758 | } |
| 759 | |
| 760 | static struct command_result *json_channel_open_failed(struct command *cmd, |
| 761 | const char *buf, |
| 762 | const jsmntok_t *params) |
| 763 | { |
| 764 | struct channel_id cid; |
| 765 | struct pending_open *open; |
| 766 | const char *err; |
| 767 | |
| 768 | err = json_scan(tmpctx, buf, params, |
| 769 | "{channel_open_failed:" |
| 770 | "{channel_id:%}}", |
| 771 | JSON_SCAN(json_to_channel_id, &cid)); |
| 772 | if (err) |
| 773 | plugin_err(cmd->plugin, |
| 774 | "`channel_open_failed` notification payload did" |
| 775 | " not scan %s: %.*s", |
| 776 | err, json_tok_full_len(params), |
| 777 | json_tok_full(buf, params)); |
| 778 | |
| 779 | plugin_log(cmd->plugin, LOG_DBG, |
| 780 | "Cleaning up inflight for channel_id %s", |
| 781 | type_to_string(tmpctx, struct channel_id, &cid)); |
| 782 | |
| 783 | open = find_channel_pending_open(&cid); |
| 784 | if (open) |
| 785 | unreserve_psbt(open); |
| 786 | |
| 787 | return notification_handled(cmd); |
| 788 | } |
| 789 | |
| 790 | static void json_add_policy(struct json_stream *stream, |
| 791 | struct funder_policy *policy) |
nothing calls this directly
no test coverage detected