~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* * To collect signatures from our peers, we use a notification watcher. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* */
| 333 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* |
| 334 | */ |
| 335 | static struct command_result * |
| 336 | openchannel_finished(struct multifundchannel_command *mfc) |
| 337 | { |
| 338 | for (size_t i = 0; i < tal_count(mfc->destinations); i++) { |
| 339 | struct multifundchannel_destination *dest; |
| 340 | dest = &mfc->destinations[i]; |
| 341 | |
| 342 | /* If there's a single failure, we have to |
| 343 | * return the failure to the user. */ |
| 344 | if (dest->state == MULTIFUNDCHANNEL_FAILED) { |
| 345 | struct json_stream *out; |
| 346 | |
| 347 | plugin_log(mfc->cmd->plugin, LOG_DBG, |
| 348 | "mfc %"PRIu64": %u failed, failing." |
| 349 | " (%d) %s", |
| 350 | mfc->id, dest->index, |
| 351 | dest->error_code, |
| 352 | dest->error_message); |
| 353 | |
| 354 | out = jsonrpc_stream_fail_data(mfc->cmd, |
| 355 | dest->error_code, |
| 356 | dest->error_message); |
| 357 | json_add_node_id(out, "id", &dest->id); |
| 358 | json_add_string(out, "method", "openchannel_signed"); |
| 359 | if (dest->error_data) |
| 360 | json_add_jsonstr(out, "data", |
| 361 | dest->error_data, |
| 362 | strlen(dest->error_data)); |
| 363 | json_object_end(out); |
| 364 | |
| 365 | return mfc_finished(mfc, out); |
| 366 | } |
| 367 | } |
| 368 | mfc->psbt = tal_free(mfc->psbt); |
| 369 | return multifundchannel_finished(mfc); |
| 370 | } |
| 371 | |
| 372 | static struct command_result * |
| 373 | after_openchannel_signed(struct multifundchannel_command *mfc) |
no test coverage detected