MCPcopy Create free account
hub / github.com/ElementsProject/lightning / fundchannel_start_ok

Function fundchannel_start_ok

plugins/spender/multifundchannel.c:1040–1073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1038}
1039
1040static struct command_result *
1041fundchannel_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
1075static struct command_result *
1076fundchannel_start_err(struct command *cmd,

Callers

nothing calls this directly

Calls 5

fmt_node_idFunction · 0.85
fundchannel_start_doneFunction · 0.85
plugin_logFunction · 0.50
json_scanFunction · 0.50
plugin_errFunction · 0.50

Tested by

no test coverage detected