Skip to content

Commit

Permalink
lightningd/opening_control: deprecate old fundchannel_complete args.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: JSON-RPC: `fundchannel_complete` txid and txout parameters (use psbt)
  • Loading branch information
rustyrussell committed Mar 12, 2021
1 parent 043e8a2 commit 1787092
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions doc/lightning-fundchannel_complete.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ lightning-fundchannel\_complete -- Command for completing channel establishment
SYNOPSIS
--------

**fundchannel\_complete** *id* *txid* *txout*
**fundchannel\_complete** *id* *psbt*

DESCRIPTION
-----------
Expand All @@ -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
Expand All @@ -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
------
Expand Down
2 changes: 1 addition & 1 deletion lightningd/opening_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions plugins/spender/multifundchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1787092

Please sign in to comment.