diff --git a/doc/lightning-fundchannel_complete.7.md b/doc/lightning-fundchannel_complete.7.md index c9ebe96430c7..c85f47eaaa61 100644 --- a/doc/lightning-fundchannel_complete.7.md +++ b/doc/lightning-fundchannel_complete.7.md @@ -4,7 +4,7 @@ lightning-fundchannel\_complete -- Command for completing channel establishment SYNOPSIS -------- -**fundchannel\_complete** *id* *txid* *txout* +**fundchannel\_complete** *id* *psbt* DESCRIPTION ----------- @@ -14,9 +14,8 @@ complete an initiated channel establishment with a connected peer. *id* is the node id of the remote peer. -*txid* is the hex string of the funding transaction id. - -*txout* is the integer outpoint of the funding output for this channel. +*psbt* is the transaction to use for funding (does not need to be +signed but must be otherwise complete). Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment @@ -37,6 +36,7 @@ with `code` being one of the following: - -1: Catchall nonspecific error. - 305: Peer is not connected. - 306: Unknown peer id. +- 309: PSBT does not have a unique, correct output to fund the channel. AUTHOR ------ diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index aa6d265900e1..03fd9d4771ac 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -965,7 +965,7 @@ static struct command_result *json_fundchannel_complete(struct command *cmd, bool old_api; /* params is NULL for initial parameter desc generation! */ - if (params /* FIXME: && deprecated_apis */) { + if (params && deprecated_apis) { /* We used to have a three-arg version. */ if (params->type == JSMN_ARRAY) old_api = (params->size == 3); diff --git a/plugins/spender/multifundchannel.c b/plugins/spender/multifundchannel.c index 693b4ecc8c81..c153d2282c68 100644 --- a/plugins/spender/multifundchannel.c +++ b/plugins/spender/multifundchannel.c @@ -683,10 +683,7 @@ fundchannel_complete_dest(struct multifundchannel_destination *dest) &fundchannel_complete_err, dest); json_add_node_id(req->js, "id", &dest->id); - json_add_string(req->js, "txid", - type_to_string(tmpctx, struct bitcoin_txid, - mfc->txid)); - json_add_num(req->js, "txout", dest->outnum); + json_add_psbt(req->js, "psbt", mfc->psbt); send_outreq(cmd->plugin, req); }