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

Function signpsbt_get_result

plugins/spender/splice.c:1081–1106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081static struct command_result *signpsbt_get_result(struct command *cmd,
1082 const char *methodname,
1083 const char *buf,
1084 const jsmntok_t *result,
1085 struct splice_cmd *splice_cmd)
1086{
1087 const jsmntok_t *tok = json_get_member(buf, result, "signed_psbt");
1088 struct channel_id *channel_ids;
1089
1090 tal_free(splice_cmd->psbt);
1091
1092 splice_cmd->psbt = json_to_psbt(splice_cmd, buf, tok);
1093 splice_cmd->wallet_inputs_to_signed = 0;
1094
1095 /* After signing we add channel_ids to the PSBT for splice_signed */
1096 channel_ids = tal_arr(NULL, struct channel_id, 0);
1097 for (size_t i = 0; i < tal_count(splice_cmd->actions); i++)
1098 if (splice_cmd->actions[i]->channel_id)
1099 tal_arr_expand(&channel_ids,
1100 *splice_cmd->actions[i]->channel_id);
1101
1102 psbt_set_channel_ids(splice_cmd->psbt, channel_ids);
1103 tal_free(channel_ids);
1104
1105 return continue_splice(splice_cmd->cmd, splice_cmd);
1106}
1107
1108static struct command_result *signpsbt(struct command *cmd,
1109 struct splice_cmd *splice_cmd)

Callers

nothing calls this directly

Calls 5

json_get_memberFunction · 0.85
tal_freeFunction · 0.85
json_to_psbtFunction · 0.85
psbt_set_channel_idsFunction · 0.85
continue_spliceFunction · 0.85

Tested by

no test coverage detected