| 369 | } |
| 370 | |
| 371 | static struct command_result * |
| 372 | openchannel_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 | |
| 411 | static struct command_result * |
| 412 | openchannel_signed_err(struct command *cmd, |
nothing calls this directly
no test coverage detected