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

Function after_sendpsbt

plugins/spender/multifundchannel.c:522–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522static struct command_result *
523after_sendpsbt(struct command *cmd,
524 const char *method,
525 const char *buf,
526 const jsmntok_t *result,
527 struct multifundchannel_command *mfc)
528{
529 const jsmntok_t *tx_tok;
530 const jsmntok_t *txid_tok;
531
532 plugin_log(mfc->cmd->plugin, LOG_DBG,
533 "mfc %"PRIu64": sendpsbt done.", mfc->id);
534
535 tx_tok = json_get_member(buf, result, "tx");
536 if (!tx_tok)
537 plugin_err(cmd->plugin,
538 "sendpsbt response has no 'tx': %.*s",
539 json_tok_full_len(result),
540 json_tok_full(buf, result));
541 mfc->final_tx = json_strdup(mfc, buf, tx_tok);
542
543 txid_tok = json_get_member(buf, result, "txid");
544 if (!txid_tok)
545 plugin_err(cmd->plugin,
546 "sendpsbt response has no 'txid': %.*s",
547 json_tok_full_len(result),
548 json_tok_full(buf, result));
549 mfc->final_txid = json_strdup(mfc, buf, txid_tok);
550
551 /* PSBT is no longer something we need to clean up. */
552 mfc->psbt = tal_free(mfc->psbt);
553
554 return multifundchannel_finished(mfc);
555}
556
557static struct command_result *
558after_signpsbt(struct command *cmd,

Callers

nothing calls this directly

Calls 8

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