df-doc: update error codes, make sure they're correct

This commit is contained in:
niftynei
2021-03-10 22:32:48 -06:00
committed by Rusty Russell
parent 0d581ddc01
commit a648ec827a
7 changed files with 40 additions and 28 deletions

View File

@@ -22,10 +22,10 @@ encumbered by the 2-of-2 script for this channel\.
\fIinitialpsbt\fR is the funded, incomplete PSBT that specifies the UTXOs and \fIinitialpsbt\fR is the funded, incomplete PSBT that specifies the UTXOs and
change output for our channel contribution\. It can be updated, change output for our channel contribution\. It can be updated,
see \fBopenchannel_update\fR; \fIinitialpsbt\fR must have at least one input to see \fBopenchannel_update\fR; \fIinitialpsbt\fR must have at least one input\.
provide a PoDLE to the peer\. Must have the Non-Witness UTXO Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for
(PSBT_IN_NON_WITNESS_UTXO) set for every input\. An error every input\. An error (code 309) will be returned if this requirement
(code 309) will be returned if this requirement is not met\. is not met\.
\fIcommitment_feerate\fR is an optional field\. Sets the feerate for \fIcommitment_feerate\fR is an optional field\. Sets the feerate for
@@ -79,6 +79,8 @@ with \fBcode\fR being one of the following:
309: PSBT missing required fields 309: PSBT missing required fields
.IP \[bu] .IP \[bu]
310: v2 channel open protocol not supported by peer 310: v2 channel open protocol not supported by peer
.IP \[bu]
312: Channel in an invalid state
.RE .RE
.SH SEE ALSO .SH SEE ALSO
@@ -96,4 +98,4 @@ lightning-fundchannel_\fBstart\fR(7), lightning-fundchannel_\fBcomplete\fR(7),
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:d73cf35c01e641d80688352058111421d9213b0a23043e9cdc807398442efd7a \" SHA256STAMP:d36c10e11609777d0d2523660dab776eb60e739bfadea5db18285cbb002ca91e

View File

@@ -21,10 +21,10 @@ encumbered by the 2-of-2 script for this channel.
*initialpsbt* is the funded, incomplete PSBT that specifies the UTXOs and *initialpsbt* is the funded, incomplete PSBT that specifies the UTXOs and
change output for our channel contribution. It can be updated, change output for our channel contribution. It can be updated,
see `openchannel_update`; *initialpsbt* must have at least one input to see `openchannel_update`; *initialpsbt* must have at least one input.
provide a PoDLE to the peer. Must have the Non-Witness UTXO Must have the Non-Witness UTXO (PSBT\_IN\_NON\_WITNESS\_UTXO) set for
(PSBT\_IN\_NON\_WITNESS\_UTXO) set for every input. An error every input. An error (code 309) will be returned if this requirement
(code 309) will be returned if this requirement is not met. is not met.
*commitment_feerate* is an optional field. Sets the feerate for *commitment_feerate* is an optional field. Sets the feerate for
commitment transactions: see **fundchannel**. commitment transactions: see **fundchannel**.
@@ -64,6 +64,7 @@ with `code` being one of the following:
- 306: Unknown peer id. - 306: Unknown peer id.
- 309: PSBT missing required fields - 309: PSBT missing required fields
- 310: v2 channel open protocol not supported by peer - 310: v2 channel open protocol not supported by peer
- 312: Channel in an invalid state
SEE ALSO SEE ALSO
-------- --------

View File

@@ -45,9 +45,13 @@ with \fBcode\fR being one of the following:
.IP \[bu] .IP \[bu]
303: Funding transaction broadcast failed\. 303: Funding transaction broadcast failed\.
.IP \[bu] .IP \[bu]
305: Peer is not connected\.
.IP \[bu]
309: PSBT missing required fields\. 309: PSBT missing required fields\.
.IP \[bu] .IP \[bu]
311: Unknown channel id\. 311: Unknown channel id\.
.IP \[bu]
312: Channel in an invalid state
.RE .RE
.SH SEE ALSO .SH SEE ALSO
@@ -65,4 +69,4 @@ lightning-fundchannel_\fBstart\fR(7), lightning-fundchannel_\fBcomplete\fR(7),
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:93ad9dfed532d0de1481a2f5d3b2030dbaf2f67df69dfcc3724e934d86d332b5 \" SHA256STAMP:1b4fe213f82746ac5773903dfef1bb84d5d80a8c9fdbf5dfc4c02ab2d84164a4

View File

@@ -38,8 +38,10 @@ with `code` being one of the following:
- -32602: If the given parameters are wrong. - -32602: If the given parameters are wrong.
- -1: Catchall nonspecific error. - -1: Catchall nonspecific error.
- 303: Funding transaction broadcast failed. - 303: Funding transaction broadcast failed.
- 305: Peer is not connected.
- 309: PSBT missing required fields. - 309: PSBT missing required fields.
- 311: Unknown channel id. - 311: Unknown channel id.
- 312: Channel in an invalid state
SEE ALSO SEE ALSO
-------- --------

View File

@@ -60,6 +60,8 @@ in the funding transaction\.
309: PSBT missing required fields 309: PSBT missing required fields
.IP \[bu] .IP \[bu]
311: Unknown channel id\. 311: Unknown channel id\.
.IP \[bu]
312: Channel in an invalid state
.RE .RE
.SH SEE ALSO .SH SEE ALSO
@@ -77,4 +79,4 @@ lightning-fundchannel_\fBstart\fR(7), lightning-fundchannel_\fBcomplete\fR(7),
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:de370bb6e61a0390a50a85e97f533238f379c908cddd822436d0ac4c72b43d6e \" SHA256STAMP:1da10d582896fe537c439b6a479fc9d8b440a43e6848b21a68b223a0ddaab24b

View File

@@ -47,6 +47,7 @@ If *commitments_secured* is true, will also return:
- 305: Peer is not connected. - 305: Peer is not connected.
- 309: PSBT missing required fields - 309: PSBT missing required fields
- 311: Unknown channel id. - 311: Unknown channel id.
- 312: Channel in an invalid state
SEE ALSO SEE ALSO
-------- --------

View File

@@ -1970,20 +1970,20 @@ json_openchannel_signed(struct command *cmd,
return command_fail(cmd, FUNDING_UNKNOWN_CHANNEL, return command_fail(cmd, FUNDING_UNKNOWN_CHANNEL,
"Unknown channel"); "Unknown channel");
if (!channel->owner) if (!channel->owner)
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_PEER_NOT_CONNECTED,
"Peer not connected"); "Peer not connected");
if (channel->open_attempt) if (channel->open_attempt)
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_STATE_INVALID,
"Commitments for this channel not " "Commitments for this channel not "
"yet secured, see `openchannel_update`"); "yet secured, see `openchannel_update`");
if (list_empty(&channel->inflights)) if (list_empty(&channel->inflights))
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_STATE_INVALID,
"Channel open not initialized yet."); "Channel open not initialized yet.");
if (channel->openchannel_signed_cmd) if (channel->openchannel_signed_cmd)
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_STATE_INVALID,
"Already sent sigs, waiting for peer's"); "Already sent sigs, waiting for peer's");
/* Verify that the psbt's txid matches that of the /* Verify that the psbt's txid matches that of the
@@ -2016,7 +2016,7 @@ json_openchannel_signed(struct command *cmd,
&inflight->funding->txid)); &inflight->funding->txid));
if (inflight->funding_psbt && psbt_is_finalized(inflight->funding_psbt)) if (inflight->funding_psbt && psbt_is_finalized(inflight->funding_psbt))
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_STATE_INVALID,
"Already have a finalized PSBT for " "Already have a finalized PSBT for "
"this channel"); "this channel");
@@ -2076,20 +2076,20 @@ static struct command_result *json_openchannel_update(struct command *cmd,
channel = channel_by_cid(cmd->ld, cid); channel = channel_by_cid(cmd->ld, cid);
if (!channel) if (!channel)
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_UNKNOWN_CHANNEL,
"Unknown channel %s", "Unknown channel %s",
type_to_string(tmpctx, struct channel_id, type_to_string(tmpctx, struct channel_id,
cid)); cid));
if (!channel->owner) if (!channel->owner)
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_PEER_NOT_CONNECTED,
"Peer not connected"); "Peer not connected");
if (!channel->open_attempt) if (!channel->open_attempt)
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_STATE_INVALID,
"Channel open not in progress"); "Channel open not in progress");
if (channel->open_attempt->cmd) if (channel->open_attempt->cmd)
return command_fail(cmd, LIGHTNINGD, return command_fail(cmd, FUNDING_STATE_INVALID,
"Another openchannel command" "Another openchannel command"
" is in progress"); " is in progress");
@@ -2206,8 +2206,8 @@ static struct command_result *json_openchannel_init(struct command *cmd,
"Peer not connected"); "Peer not connected");
if (channel->open_attempt if (channel->open_attempt
|| !list_empty(&channel->inflights)) || !list_empty(&channel->inflights))
return command_fail(cmd, LIGHTNINGD, "Channel funding" return command_fail(cmd, FUNDING_STATE_INVALID,
" in-progress. %s", "Channel funding in-progress. %s",
channel_state_name(channel)); channel_state_name(channel));
#if EXPERIMENTAL_FEATURES #if EXPERIMENTAL_FEATURES