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

Function openchannel_signed_ok

plugins/spender/openchannel.c:382–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

json_get_memberFunction · 0.85
tal_freeFunction · 0.85
after_openchannel_signedFunction · 0.85
plugin_logFunction · 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