From 89466f0e55d024b413fdf7fb15d70b05194c52e3 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Sun, 5 Jan 2020 16:40:17 +0100 Subject: [PATCH] doc: list the error codes of funding_* commands Changelog-None --- doc/lightning-fundchannel_cancel.7 | 15 ++++++++++++++- doc/lightning-fundchannel_cancel.7.md | 7 ++++++- doc/lightning-fundchannel_complete.7 | 20 ++++++++++++++------ doc/lightning-fundchannel_complete.7.md | 8 +++++++- doc/lightning-fundchannel_start.7 | 22 ++++++++++++++++++++-- doc/lightning-fundchannel_start.7.md | 11 ++++++++++- 6 files changed, 71 insertions(+), 12 deletions(-) diff --git a/doc/lightning-fundchannel_cancel.7 b/doc/lightning-fundchannel_cancel.7 index 2d5eba416..feb9e12d4 100644 --- a/doc/lightning-fundchannel_cancel.7 +++ b/doc/lightning-fundchannel_cancel.7 @@ -10,12 +10,15 @@ lightning-fundchannel_cancel - Command for completing channel establishment \fBfundchannel_cancel\fR is a lower level RPC command\. It allows channel funder to cancel a channel before funding broadcast with a connected peer\. + \fIid\fR is the node id of the remote peer with which to cancel\. + Note that the funding transaction MUST NOT be broadcast before \fBfundchannel_cancel\fR\. Broadcasting transaction before \fBfundchannel_cancel\fR WILL lead to unrecoverable loss of funds\. + If \fBfundchannel_cancel\fR is called after \fBfundchannel_complete\fR, the remote peer may disconnect when command succeeds\. In this case, user need to connect to remote peer again before opening channel\. @@ -26,8 +29,18 @@ On success, returns confirmation that the channel establishment has been canceled\. -On failure, returns an error\. +On error the returned object will contain \fBcode\fR and \fBmessage\fR properties, +with \fBcode\fR being one of the following: + +.RS +.IP \[bu] +-32602: If the given parameters are wrong\. +.IP \[bu] +-1: Catchall nonspecific error\. +.IP \[bu] +306: Unknown peer id\. +.RE .SH AUTHOR Lisa Neigut \fI is mainly responsible\. diff --git a/doc/lightning-fundchannel_cancel.7.md b/doc/lightning-fundchannel_cancel.7.md index 12540aff3..70e821e85 100644 --- a/doc/lightning-fundchannel_cancel.7.md +++ b/doc/lightning-fundchannel_cancel.7.md @@ -28,7 +28,12 @@ RETURN VALUE On success, returns confirmation that the channel establishment has been canceled. -On failure, returns an error. +On error the returned object will contain `code` and `message` properties, +with `code` being one of the following: + +- -32602: If the given parameters are wrong. +- -1: Catchall nonspecific error. +- 306: Unknown peer id. AUTHOR ------ diff --git a/doc/lightning-fundchannel_complete.7 b/doc/lightning-fundchannel_complete.7 index da035ca99..cfea239ce 100644 --- a/doc/lightning-fundchannel_complete.7 +++ b/doc/lightning-fundchannel_complete.7 @@ -32,8 +32,20 @@ On success, returns a confirmation that \fIcommitments_secured\fR and the derived \fIchannel_id\fR\. -On failure, returns an error\. - +On error the returned object will contain \fBcode\fR and \fBmessage\fR properties, +with \fBcode\fR being one of the following: + +.RS +.IP \[bu] +-32602: If the given parameters are wrong\. +.IP \[bu] +-1: Catchall nonspecific error\. +.IP \[bu] +305: Peer is not connected\. +.IP \[bu] +306: Unknown peer id\. + +.RE .SH AUTHOR Lisa Neigut \fI is mainly responsible\. @@ -47,7 +59,3 @@ lightning-fundchannel_\fBstart\fR(7), lightning-fundchannel_\fBcancel\fR(7) Main web site: \fIhttps://github.com/ElementsProject/lightning\fR -.HL - -Last updated 2019-06-12 11:16:20 CEST - diff --git a/doc/lightning-fundchannel_complete.7.md b/doc/lightning-fundchannel_complete.7.md index 2dd5cd918..a700bc3e0 100644 --- a/doc/lightning-fundchannel_complete.7.md +++ b/doc/lightning-fundchannel_complete.7.md @@ -30,7 +30,13 @@ RETURN VALUE On success, returns a confirmation that *commitments\_secured* and the derived *channel\_id*. -On failure, returns an error. +On error the returned object will contain `code` and `message` properties, +with `code` being one of the following: + +- -32602: If the given parameters are wrong. +- -1: Catchall nonspecific error. +- 305: Peer is not connected. +- 306: Unknown peer id. AUTHOR ------ diff --git a/doc/lightning-fundchannel_start.7 b/doc/lightning-fundchannel_start.7 index 365ef24d5..6255d3180 100644 --- a/doc/lightning-fundchannel_start.7 +++ b/doc/lightning-fundchannel_start.7 @@ -50,8 +50,26 @@ If a \fBclose_to\fR address was provided, will close to this address iff the \fB returned in the response\. Otherwise, the peer does not support \fBoption_upfront_shutdownscript\fR\. -On failure, returns an error\. - +On error the returned object will contain \fBcode\fR and \fBmessage\fR properties, +with \fBcode\fR being one of the following: + +.RS +.IP \[bu] +-32602: If the given parameters are wrong\. +.IP \[bu] +-1: Catchall nonspecific error\. +.IP \[bu] +300: The amount exceeded the maximum configured funding amount\. +.IP \[bu] +301: The provided \fBpush_msat\fR is greater than the provided \fBamount\fR\. +.IP \[bu] +304: Still syncing with bitcoin network +.IP \[bu] +305: Peer is not connected\. +.IP \[bu] +306: Unknown peer id\. + +.RE .SH AUTHOR Lisa Neigut \fI is mainly responsible\. diff --git a/doc/lightning-fundchannel_start.7.md b/doc/lightning-fundchannel_start.7.md index b0f8b1790..b0f3efd68 100644 --- a/doc/lightning-fundchannel_start.7.md +++ b/doc/lightning-fundchannel_start.7.md @@ -45,7 +45,16 @@ On success, returns the *funding\_address* and the *scriptpubkey* for the channe If a `close_to` address was provided, will close to this address iff the `close_to` address is returned in the response. Otherwise, the peer does not support `option_upfront_shutdownscript`. -On failure, returns an error. +On error the returned object will contain `code` and `message` properties, +with `code` being one of the following: + +- -32602: If the given parameters are wrong. +- -1: Catchall nonspecific error. +- 300: The amount exceeded the maximum configured funding amount. +- 301: The provided `push_msat` is greater than the provided `amount`. +- 304: Still syncing with bitcoin network +- 305: Peer is not connected. +- 306: Unknown peer id. AUTHOR ------