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

Function openchannel_signed_ok

plugins/spender/openchannel.c:371–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371static struct command_result *
372openchannel_signed_ok(struct command *cmd,
373 const char *buf,
374 const jsmntok_t *result,
375 struct multifundchannel_destination *dest)
376{
377 struct multifundchannel_command *mfc = dest->mfc;
378
379 plugin_log(mfc->cmd->plugin, LOG_DBG,
380 "mfc %"PRIu64", dest %u: `openchannel_signed` done",
381 mfc->id, dest->index);
382
383 /* One of the other commands might have landed here first */
384 if (!mfc->final_tx) {
385 const jsmntok_t *tx_tok, *txid_tok;
386
387 tx_tok = json_get_member(buf, result, "tx");
388 if (!tx_tok)
389 plugin_err(mfc->cmd->plugin,
390 "`openchannel_signed` has no 'tx': %.*s",
391 json_tok_full_len(result),
392 json_tok_full(buf, result));
393
394 mfc->final_tx = json_strdup(mfc, buf, tx_tok);
395
396 txid_tok = json_get_member(buf, result, "txid");
397 if (!txid_tok)
398 plugin_err(mfc->cmd->plugin,
399 "`openchannel_signed` has no 'txid': %.*s",
400 json_tok_full_len(result),
401 json_tok_full(buf, result));
402
403 mfc->final_txid = json_strdup(mfc, buf, txid_tok);
404 }
405
406 /* We done !? */
407 dest->psbt = tal_free(dest->psbt);
408 return after_openchannel_signed(mfc);
409}
410
411static struct command_result *
412openchannel_signed_err(struct command *cmd,

Callers

nothing calls this directly

Calls 8

tal_freeFunction · 0.85
after_openchannel_signedFunction · 0.85
plugin_logFunction · 0.50
json_get_memberFunction · 0.50
plugin_errFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50
json_strdupFunction · 0.50

Tested by

no test coverage detected