Skip to content

Commit 00121a6

Browse files
committed
lightningd/opening_control: deprecate old fundchannel_complete args.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Deprecated: JSON-RPC: `fundchannel_complete` txid and txout parameters (use psbt)
1 parent 043e8a2 commit 00121a6

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

doc/lightning-fundchannel_complete.7

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/lightning-fundchannel_complete.7.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ lightning-fundchannel\_complete -- Command for completing channel establishment
44
SYNOPSIS
55
--------
66

7-
**fundchannel\_complete** *id* *txid* *txout*
7+
**fundchannel\_complete** *id* *psbt*
88

99
DESCRIPTION
1010
-----------
@@ -14,9 +14,8 @@ complete an initiated channel establishment with a connected peer.
1414

1515
*id* is the node id of the remote peer.
1616

17-
*txid* is the hex string of the funding transaction id.
18-
19-
*txout* is the integer outpoint of the funding output for this channel.
17+
*psbt* is the transaction to use for funding (does not need to be
18+
signed but must be otherwise complete).
2019

2120
Note that the funding transaction MUST NOT be broadcast until after
2221
channel establishment has been successfully completed, as the commitment
@@ -37,6 +36,7 @@ with `code` being one of the following:
3736
- -1: Catchall nonspecific error.
3837
- 305: Peer is not connected.
3938
- 306: Unknown peer id.
39+
- 309: PSBT does not have a unique, correct output to fund the channel.
4040

4141
AUTHOR
4242
------

lightningd/opening_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ static struct command_result *json_fundchannel_complete(struct command *cmd,
965965
bool old_api;
966966

967967
/* params is NULL for initial parameter desc generation! */
968-
if (params /* FIXME: && deprecated_apis */) {
968+
if (params && deprecated_apis) {
969969
/* We used to have a three-arg version. */
970970
if (params->type == JSMN_ARRAY)
971971
old_api = (params->size == 3);

plugins/spender/multifundchannel.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,7 @@ fundchannel_complete_dest(struct multifundchannel_destination *dest)
683683
&fundchannel_complete_err,
684684
dest);
685685
json_add_node_id(req->js, "id", &dest->id);
686-
json_add_string(req->js, "txid",
687-
type_to_string(tmpctx, struct bitcoin_txid,
688-
mfc->txid));
689-
json_add_num(req->js, "txout", dest->outnum);
686+
json_add_psbt(req->js, "psbt", mfc->psbt);
690687

691688
send_outreq(cmd->plugin, req);
692689
}

0 commit comments

Comments
 (0)