lightningd/opening_control: allow single-arg fundchannel_complete with PSBT

Requiring the user to calculate the txid of the PSBT is a horrible, bad,
no-good idea.

Doesn't deprecate yet, so I can test that this path works while
multifundchannel still uses it.

Fixes: #4416 (at least for future users!)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `fundchannel_complete` takes a psbt parameter.
This commit is contained in:
Rusty Russell
2021-03-15 14:57:56 +10:30
parent bf928ef47a
commit da7ba6c146
3 changed files with 85 additions and 25 deletions

View File

@@ -3,7 +3,7 @@
lightning-fundchannel_complete - Command for completing channel establishment
.SH SYNOPSIS
\fBfundchannel_complete\fR \fIid\fR \fItxid\fR \fItxout\fR
\fBfundchannel_complete\fR \fIid\fR \fIpsbt\fR
.SH DESCRIPTION
@@ -14,10 +14,8 @@ complete an initiated channel establishment with a connected peer\.
\fIid\fR is the node id of the remote peer\.
\fItxid\fR is the hex string of the funding transaction id\.
\fItxout\fR is the integer outpoint of the funding output for this channel\.
\fIpsbt\fR 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
@@ -44,6 +42,8 @@ with \fBcode\fR being one of the following:
305: Peer is not connected\.
.IP \[bu]
306: Unknown peer id\.
.IP \[bu]
309: PSBT does not have a unique, correct output to fund the channel\.
.RE
.SH AUTHOR
@@ -62,4 +62,4 @@ lightning-openchannel_\fBabort\fR(7)
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:53e7f55055cdfb8cf66e89ba76a1cfa6fffaa5d6e72b441c44e7e6065707fc66
\" SHA256STAMP:13e5fee7b987b38e9b08685f4b49062314ec9e2cf52afbb5a2c5a4965fe2b01f

View File

@@ -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
------