Skip to content

Commit e1b1abd

Browse files
rustyrussellcdecker
authored andcommitted
doc: fix argument documentation for lightning-sendpay.
The parameter is 'payment_hash' not 'hash', and the 'description' parameter wasn't documented at all. Reported-by: @darosior Signed-off-by: Rusty Russell <[email protected]>
1 parent f3329d6 commit e1b1abd

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

doc/lightning-sendpay.7

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: lightning-sendpay
33
.\" Author: [see the "AUTHOR" section]
44
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
5-
.\" Date: 03/22/2018
5+
.\" Date: 10/23/2018
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "LIGHTNING\-SENDPAY" "7" "03/22/2018" "\ \&" "\ \&"
10+
.TH "LIGHTNING\-SENDPAY" "7" "10/23/2018" "\ \&" "\ \&"
1111
.\" -----------------------------------------------------------------
1212
.\" * Define some portability stuff
1313
.\" -----------------------------------------------------------------
@@ -31,23 +31,25 @@
3131
lightning-sendpay \- Command for sending a payment via a route\&.
3232
.SH "SYNOPSIS"
3333
.sp
34-
\fBsendpay\fR \fIroute\fR \fIhash\fR [\fImsatoshi\fR]
34+
\fBsendpay\fR \fIroute\fR \fIpayment_hash\fR [\fIdescription\fR] [\fImsatoshi\fR]
3535
.SH "DESCRIPTION"
3636
.sp
37-
The \fBsendpay\fR RPC command attempts to send funds associated with the given \fIhash\fR, along a route to the final destination in the route\&.
37+
The \fBsendpay\fR RPC command attempts to send funds associated with the given payment_\(cqhash\*(Aq, along a route to the final destination in the route\&.
3838
.sp
39-
Generally, a client would call getroute(7) to resolve a route, then use \fBsendpay\fR to send it\&. If it fails, it would call getroute(7) again to retry\&.
39+
Generally, a client would call lightning\-getroute(7) to resolve a route, then use \fBsendpay\fR to send it\&. If it fails, it would call lightning\-getroute(7) again to retry\&.
4040
.sp
4141
The response will occur when the payment is on its way to the destination\&. The \fBsendpay\fR RPC command does not wait for definite success or definite failure of the payment\&. Instead, use the \fBwaitsendpay\fR RPC command to poll or wait for definite success or definite failure\&.
4242
.sp
43+
The \fIdescription\fR parameter, if provided, will be returned in \fIwaitsendpay\fR and \fIlistpayments\fR results\&.
44+
.sp
4345
The \fImsatoshi\fR amount, if provided, is the amount that will be recorded as the target payment value\&. If not specified, it will be the final amount to the destination\&. If specified, then the final amount at the destination must be from the specified \fImsatoshi\fR to twice the specified \fImsatoshi\fR, inclusive\&. This is intended to obscure payments by overpaying slightly at the destination; the actual target payment is what should be specified as the \fImsatoshi\fR argument\&.
4446
.sp
45-
Once a payment has succeeded, calls to \fBsendpay\fR with the same \fIhash\fR but a different \fImsatoshi\fR or destination will fail; this prevents accidental multiple payments\&. Calls to \fBsendpay\fR with the same \fIhash\fR, \fImsatoshi\fR, and destination as a previous successful payment (even if a different route) will return immediately with success\&.
47+
Once a payment has succeeded, calls to \fBsendpay\fR with the same \fIpayment_hash\fR but a different \fImsatoshi\fR or destination will fail; this prevents accidental multiple payments\&. Calls to \fBsendpay\fR with the same \fIpayment_hash\fR, \fImsatoshi\fR, and destination as a previous successful payment (even if a different route) will return immediately with success\&.
4648
.SH "RETURN VALUE"
4749
.sp
4850
On success, an object similar to the output of \fBlistpayments\fR will be returned\&. This object will have a \fIstatus\fR field that is typically the string \fI"pending"\fR, but may be \fI"complete"\fR if the payment was already performed successfully\&.
4951
.sp
50-
On error, if the error occurred from a node other than the final destination, the route table will be updated so that getroute(7) should return an alternate route (if any)\&. An error from the final destination implies the payment should not be retried\&.
52+
On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning\-getroute(7) should return an alternate route (if any)\&. An error from the final destination implies the payment should not be retried\&.
5153
.sp
5254
The following error codes may occur:
5355
.sp

doc/lightning-sendpay.7.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ lightning-sendpay - Command for sending a payment via a route.
88

99
SYNOPSIS
1010
--------
11-
*sendpay* 'route' 'hash' ['msatoshi']
11+
*sendpay* 'route' 'payment_hash' ['description'] ['msatoshi']
1212

1313
DESCRIPTION
1414
-----------
1515

1616
The *sendpay* RPC command attempts to send funds associated with the
17-
given 'hash', along a route to the final destination in the route.
17+
given payment_'hash', along a route to the final destination in the route.
1818

19-
Generally, a client would call getroute(7) to resolve a route, then
20-
use *sendpay* to send it. If it fails, it would call getroute(7)
19+
Generally, a client would call lightning-getroute(7) to resolve a route, then
20+
use *sendpay* to send it. If it fails, it would call lightning-getroute(7)
2121
again to retry.
2222

2323
The response will occur when the payment is on its way to the
@@ -27,6 +27,9 @@ definite failure of the payment.
2727
Instead, use the *waitsendpay* RPC command to poll or wait for
2828
definite success or definite failure.
2929

30+
The 'description' parameter, if provided, will be returned in
31+
'waitsendpay' and 'listpayments' results.
32+
3033
The 'msatoshi' amount, if provided, is the amount that will be
3134
recorded as the target payment value.
3235
If not specified, it will be the final amount to the destination.
@@ -38,10 +41,10 @@ the destination;
3841
the actual target payment is what should be specified as the
3942
'msatoshi' argument.
4043

41-
Once a payment has succeeded, calls to *sendpay* with the same 'hash'
44+
Once a payment has succeeded, calls to *sendpay* with the same 'payment_hash'
4245
but a different 'msatoshi' or destination will fail; this prevents
4346
accidental multiple payments.
44-
Calls to *sendpay* with the same 'hash', 'msatoshi', and destination as a
47+
Calls to *sendpay* with the same 'payment_hash', 'msatoshi', and destination as a
4548
previous successful payment (even if a different route) will return
4649
immediately with success.
4750

@@ -55,7 +58,7 @@ string '"pending"', but may be '"complete"' if the payment was
5558
already performed successfully.
5659

5760
On error, if the error occurred from a node other than the final
58-
destination, the route table will be updated so that getroute(7)
61+
destination, the route table will be updated so that lightning-getroute(7)
5962
should return an alternate route (if any). An error from the final
6063
destination implies the payment should not be retried.
6164

0 commit comments

Comments
 (0)