JSONRPC: Make listinvoice an deprecated alias for listinvoices.

This matches the other names, and also the return value is about to change.

This will be removed before release!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-01-17 06:58:46 +10:30
parent 6e703ad977
commit 1a641c823c
4 changed files with 23 additions and 14 deletions

View file

@ -9,7 +9,7 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-delinvoice.7 \ doc/lightning-delinvoice.7 \
doc/lightning-getroute.7 \ doc/lightning-getroute.7 \
doc/lightning-invoice.7 \ doc/lightning-invoice.7 \
doc/lightning-listinvoice.7 \ doc/lightning-listinvoices.7 \
doc/lightning-listpayments.7 \ doc/lightning-listpayments.7 \
doc/lightning-pay.7 \ doc/lightning-pay.7 \
doc/lightning-sendpay.7 \ doc/lightning-sendpay.7 \

View file

@ -1,13 +1,13 @@
'\" t '\" t
.\" Title: lightning-listinvoice .\" Title: lightning-listinvoices
.\" Author: [see the "AUTHOR" section] .\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/13/2018 .\" Date: 01/16/2018
.\" Manual: \ \& .\" Manual: \ \&
.\" Source: \ \& .\" Source: \ \&
.\" Language: English .\" Language: English
.\" .\"
.TH "LIGHTNING\-LISTINVOI" "7" "01/13/2018" "\ \&" "\ \&" .TH "LIGHTNING\-LISTINVOI" "7" "01/16/2018" "\ \&" "\ \&"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@ -28,13 +28,13 @@
.\" * MAIN CONTENT STARTS HERE * .\" * MAIN CONTENT STARTS HERE *
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.SH "NAME" .SH "NAME"
lightning-listinvoice \- Protocol for querying invoice status lightning-listinvoices \- Protocol for querying invoice status
.SH "SYNOPSIS" .SH "SYNOPSIS"
.sp .sp
\fBlistinvoice\fR [\fIlabel\fR] \fBlistinvoices\fR [\fIlabel\fR]
.SH "DESCRIPTION" .SH "DESCRIPTION"
.sp .sp
The \fBlistinvoice\fR RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument\&. The \fBlistinvoices\fR RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument\&.
.SH "RETURN VALUE" .SH "RETURN VALUE"
.sp .sp
On success, an array \fIinvoices\fR of objects is returned\&. Each object contains \fIlabel\fR, \fIpayment_hash, \*(Aqcomplete\fR (a boolean), and \fIexpiry_time\fR (a UNIX timestamp)\&. If the \fImsatoshi\fR argument to lightning\-invoice(7) was not "any", there will be an \fImsatoshi\fR field\&. If the invoice has been paid, there will be a \fIpay_index\fR field and an \fImsatoshi_received\fR field (which may be slightly greater than \fImsatoshi\fR as some overpaying is permitted to allow clients to obscure payment paths)\&. On success, an array \fIinvoices\fR of objects is returned\&. Each object contains \fIlabel\fR, \fIpayment_hash, \*(Aqcomplete\fR (a boolean), and \fIexpiry_time\fR (a UNIX timestamp)\&. If the \fImsatoshi\fR argument to lightning\-invoice(7) was not "any", there will be an \fImsatoshi\fR field\&. If the invoice has been paid, there will be a \fIpay_index\fR field and an \fImsatoshi_received\fR field (which may be slightly greater than \fImsatoshi\fR as some overpaying is permitted to allow clients to obscure payment paths)\&.

View file

@ -1,18 +1,18 @@
LIGHTNING-LISTINVOICE(7) LIGHTNING-LISTINVOICES(7)
======================== =========================
:doctype: manpage :doctype: manpage
NAME NAME
---- ----
lightning-listinvoice - Protocol for querying invoice status lightning-listinvoices - Protocol for querying invoice status
SYNOPSIS SYNOPSIS
-------- --------
*listinvoice* ['label'] *listinvoices* ['label']
DESCRIPTION DESCRIPTION
----------- -----------
The *listinvoice* RPC command gets the status of a specific invoice, if The *listinvoices* RPC command gets the status of a specific invoice, if
it exists, or the status of all invoices if given no argument. it exists, or the status of all invoices if given no argument.
RETURN VALUE RETURN VALUE

View file

@ -222,11 +222,20 @@ static void json_listinvoice(struct command *cmd,
static const struct json_command listinvoice_command = { static const struct json_command listinvoice_command = {
"listinvoice", "listinvoice",
json_listinvoice, json_listinvoice,
"Show invoice {label} (or all, if no {label}))", "(DEPRECATED) Show invoice {label} (or all, if no {label}))",
"Returns an array of {label}, {payment_hash}, {msatoshi} (if set), {complete}, {pay_index} (if paid) and {expiry_time} on success. " "Returns an array of {label}, {payment_hash}, {msatoshi} (if set), {complete}, {pay_index} (if paid) and {expiry_time} on success. ",
.deprecated = true
}; };
AUTODATA(json_command, &listinvoice_command); AUTODATA(json_command, &listinvoice_command);
static const struct json_command listinvoice_command = {
"listinvoices",
json_listinvoices,
"Show invoice {label} (or all, if no {label}))",
"Returns an array of {label}, {payment_hash}, {msatoshi} (if set), {complete}, {pay_index} (if paid) and {expiry_time} on success. ",
};
AUTODATA(json_command, &listinvoices_command);
static void json_delinvoice(struct command *cmd, static void json_delinvoice(struct command *cmd,
const char *buffer, const jsmntok_t *params) const char *buffer, const jsmntok_t *params)
{ {