From c6b45e052bfb6dbda362f753bbf0b07207170847 Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 22 Oct 2020 14:32:45 -0500 Subject: [PATCH] mfc-df: after openchannel_signed is finished, we call finished We done!? --- plugins/spender/multifundchannel.c | 5 +---- plugins/spender/multifundchannel.h | 3 +++ plugins/spender/openchannel.c | 34 +----------------------------- 3 files changed, 5 insertions(+), 37 deletions(-) diff --git a/plugins/spender/multifundchannel.c b/plugins/spender/multifundchannel.c index f3c6b7490..0a76b52ff 100644 --- a/plugins/spender/multifundchannel.c +++ b/plugins/spender/multifundchannel.c @@ -1635,9 +1635,6 @@ after_signpsbt(struct command *cmd, return send_outreq(mfc->cmd->plugin, req); } -static struct command_result * -multifundchannel_finished(struct multifundchannel_command *mfc); - static struct command_result * after_sendpsbt(struct command *cmd, const char *buf, @@ -1677,7 +1674,7 @@ after_sendpsbt(struct command *cmd, And finally we are done. */ -static struct command_result * +struct command_result * multifundchannel_finished(struct multifundchannel_command *mfc) { unsigned int i; diff --git a/plugins/spender/multifundchannel.h b/plugins/spender/multifundchannel.h index ff6e53138..647bee837 100644 --- a/plugins/spender/multifundchannel.h +++ b/plugins/spender/multifundchannel.h @@ -262,6 +262,9 @@ perform_fundchannel_complete(struct multifundchannel_command *mfc); struct command_result * perform_signpsbt(struct multifundchannel_command *mfc); +struct command_result * +multifundchannel_finished(struct multifundchannel_command *mfc); + struct command_result * redo_multifundchannel(struct multifundchannel_command *mfc, const char *failing_method); diff --git a/plugins/spender/openchannel.c b/plugins/spender/openchannel.c index 0e834732d..1cebc0d35 100644 --- a/plugins/spender/openchannel.c +++ b/plugins/spender/openchannel.c @@ -329,41 +329,9 @@ static bool update_node_psbt(const tal_t *ctx, static struct command_result * openchannel_finished(struct multifundchannel_command *mfc) { - struct json_stream *out; - - plugin_log(mfc->cmd->plugin, LOG_DBG, - "mfc %"PRIu64": done.", mfc->id); - - out = jsonrpc_stream_success(mfc->cmd); - json_add_string(out, "tx", mfc->final_tx); - json_add_string(out, "txid", mfc->final_txid); - json_array_start(out, "channel_ids"); - for (size_t i = 0; i < tal_count(mfc->destinations); i++) { - struct multifundchannel_destination *dest = - &mfc->destinations[i]; - - json_object_start(out, NULL); - json_add_node_id(out, "id", &dest->id); - json_add_channel_id(out, "channel_id", &dest->channel_id); - json_add_num(out, "outnum", dest->outnum); - json_object_end(out); - } - json_array_end(out); - - json_array_start(out, "failed"); - for (size_t i = 0; i < tal_count(mfc->removeds); i++) { - struct multifundchannel_removed *rm = - &mfc->removeds[i]; - json_object_start(out, NULL); - json_add_node_id(out, "id", &rm->id); - json_add_string(out, "method", rm->method); - json_add_jsonstr(out, "error", rm->error); - json_object_end(out); - } - json_array_end(out); mfc->psbt = tal_free(mfc->psbt); - return mfc_finished(mfc, out); + return multifundchannel_finished(mfc); } static struct command_result *