Browse Source

sendonion: add bolt11 arg.

And document the partid arg.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `sendonion` has a new optional `bolt11` argument for when it's used to pay an invoice.
exclude-equal-hint
Rusty Russell 5 years ago
committed by Christian Decker
parent
commit
71a2aefafd
  1. 10
      doc/lightning-sendonion.7
  2. 8
      doc/lightning-sendonion.7.md
  3. 5
      lightningd/pay.c

10
doc/lightning-sendonion.7

@ -3,7 +3,7 @@
lightning-sendonion - Send a payment with a custom onion packet lightning-sendonion - Send a payment with a custom onion packet
.SH SYNOPSIS .SH SYNOPSIS
\fBsendonion\fR \fIonion\fR \fIfirst_hop\fR \fIpayment_hash\fR [\fIlabel\fR] [\fIshared_secrets\fR] \fBsendonion\fR \fIonion\fR \fIfirst_hop\fR \fIpayment_hash\fR [\fIlabel\fR] [\fIshared_secrets\fR] [\fIpartid\fR] [\fIbolt11\fR]
.SH DESCRIPTION .SH DESCRIPTION
@ -81,6 +81,14 @@ If \fIshared_secrets\fR is not provided the c-lightning node does not know how
long the route is, which channels or nodes are involved, and what an eventual long the route is, which channels or nodes are involved, and what an eventual
error could have been\. It can therefore be used for oblivious payments\. error could have been\. It can therefore be used for oblivious payments\.
The \fIpartid\fR value, if provided and non-zero, allows for multiple parallel
partial payments with the same \fIpayment_hash\fR\.
The \fIbolt11\fR parameter, if provided, will be returned in
\fIwaitsendpay\fR and \fIlistsendpays\fR results\.
.SH RETURN VALUE .SH RETURN VALUE
On success, an object similar to the output of \fBsendpay\fR will be On success, an object similar to the output of \fBsendpay\fR will be

8
doc/lightning-sendonion.7.md

@ -4,7 +4,7 @@ lightning-sendonion -- Send a payment with a custom onion packet
SYNOPSIS SYNOPSIS
-------- --------
**sendonion** *onion* *first_hop* *payment_hash* \[*label*\] \[*shared_secrets*\] **sendonion** *onion* *first_hop* *payment_hash* \[*label*\] \[*shared_secrets*\] \[*partid*\] \[*bolt11*\]
DESCRIPTION DESCRIPTION
----------- -----------
@ -72,6 +72,12 @@ If *shared_secrets* is not provided the c-lightning node does not know how
long the route is, which channels or nodes are involved, and what an eventual long the route is, which channels or nodes are involved, and what an eventual
error could have been. It can therefore be used for oblivious payments. error could have been. It can therefore be used for oblivious payments.
The *partid* value, if provided and non-zero, allows for multiple parallel
partial payments with the same *payment_hash*.
The *bolt11* parameter, if provided, will be returned in
*waitsendpay* and *listsendpays* results.
RETURN VALUE RETURN VALUE
------------ ------------

5
lightningd/pay.c

@ -1183,7 +1183,7 @@ static struct command_result *json_sendonion(struct command *cmd,
struct route_hop *first_hop; struct route_hop *first_hop;
struct sha256 *payment_hash; struct sha256 *payment_hash;
struct lightningd *ld = cmd->ld; struct lightningd *ld = cmd->ld;
const char *label; const char *label, *b11str;
struct secret *path_secrets; struct secret *path_secrets;
u64 *partid; u64 *partid;
@ -1194,6 +1194,7 @@ static struct command_result *json_sendonion(struct command *cmd,
p_opt("label", param_escaped_string, &label), p_opt("label", param_escaped_string, &label),
p_opt("shared_secrets", param_secrets_array, &path_secrets), p_opt("shared_secrets", param_secrets_array, &path_secrets),
p_opt_def("partid", param_u64, &partid, 0), p_opt_def("partid", param_u64, &partid, 0),
p_opt("bolt11", param_string, &b11str),
NULL)) NULL))
return command_param_failed(); return command_param_failed();
@ -1207,7 +1208,7 @@ static struct command_result *json_sendonion(struct command *cmd,
return send_payment_core(ld, cmd, payment_hash, *partid, return send_payment_core(ld, cmd, payment_hash, *partid,
first_hop, AMOUNT_MSAT(0), AMOUNT_MSAT(0), first_hop, AMOUNT_MSAT(0), AMOUNT_MSAT(0),
label, NULL, &packet, NULL, NULL, NULL, label, b11str, &packet, NULL, NULL, NULL,
path_secrets); path_secrets);
} }

Loading…
Cancel
Save