| 1038 | } |
| 1039 | |
| 1040 | static struct command_result * |
| 1041 | fundchannel_start_ok(struct command *cmd, |
| 1042 | const char *method, |
| 1043 | const char *buf, |
| 1044 | const jsmntok_t *result, |
| 1045 | struct multifundchannel_destination *dest) |
| 1046 | { |
| 1047 | struct multifundchannel_command *mfc = dest->mfc; |
| 1048 | const char *err; |
| 1049 | |
| 1050 | plugin_log(mfc->cmd->plugin, LOG_DBG, |
| 1051 | "mfc %"PRIu64", dest %u: fundchannel_start %s done.", |
| 1052 | mfc->id, dest->index, |
| 1053 | fmt_node_id(tmpctx, &dest->id)); |
| 1054 | |
| 1055 | /* May not be set */ |
| 1056 | dest->close_to_script = NULL; |
| 1057 | err = json_scan(mfc, buf, result, |
| 1058 | "{funding_address:%," |
| 1059 | "scriptpubkey:%," |
| 1060 | "channel_type:{bits:%}," |
| 1061 | "close_to?:%}", |
| 1062 | JSON_SCAN_TAL(mfc, json_strdup, &dest->funding_addr), |
| 1063 | JSON_SCAN_TAL(mfc, json_tok_bin_from_hex, &dest->funding_script), |
| 1064 | JSON_SCAN_TAL(mfc, json_bits_to_channel_type, &dest->channel_type), |
| 1065 | JSON_SCAN_TAL(mfc, json_tok_bin_from_hex, &dest->close_to_script)); |
| 1066 | if (err) |
| 1067 | plugin_err(cmd->plugin, |
| 1068 | "fundchannel_start parsing error: %s", err); |
| 1069 | |
| 1070 | dest->state = MULTIFUNDCHANNEL_STARTED; |
| 1071 | |
| 1072 | return fundchannel_start_done(dest); |
| 1073 | } |
| 1074 | |
| 1075 | static struct command_result * |
| 1076 | fundchannel_start_err(struct command *cmd, |
nothing calls this directly
no test coverage detected