Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sendonion: add total amount #8015

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -3319,7 +3319,8 @@
"SendOnion.onion": 1,
"SendOnion.partid": 6,
"SendOnion.payment_hash": 3,
"SendOnion.shared_secrets[]": 5
"SendOnion.shared_secrets[]": 5,
"SendOnion.total_amount_msat": 15
},
"SendonionResponse": {
"SendOnion.amount_msat": 4,
Expand Down Expand Up @@ -11881,6 +11882,10 @@
"added": "pre-v0.10.1",
"deprecated": null
},
"SendOnion.total_amount_msat": {
"added": "v25.02",
"deprecated": null
},
"SendOnion.updated_index": {
"added": "v23.11",
"deprecated": null
Expand Down
1 change: 1 addition & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31254,6 +31254,13 @@
"Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*."
]
},
"total_amount_msat": {
"type": "msat",
"description": [
"This is the full amount requested by the destination in the invoice. It is needed internally for multi-part payments. "
],
"added": "v25.02"
},
"destination": {
"type": "pubkey",
"description": [
Expand Down
1,776 changes: 888 additions & 888 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions doc/schemas/lightning-sendonion.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@
"Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*."
]
},
"total_amount_msat": {
"type": "msat",
"description": [
"This is the full amount requested by the destination in the invoice. It is needed internally for multi-part payments. "
],
"added": "v25.02"
},
"destination": {
"type": "pubkey",
"description": [
Expand Down
6 changes: 4 additions & 2 deletions lightningd/pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ static struct command_result *json_sendonion(struct command *cmd,
const char *label, *invstring, *description;
struct node_id *destination;
struct secret *path_secrets;
struct amount_msat *msat;
struct amount_msat *msat, *total_msat;
u64 *partid, *group;
struct sha256 *local_invreq_id = NULL;

Expand All @@ -1343,6 +1343,7 @@ static struct command_result *json_sendonion(struct command *cmd,
/* FIXME: parameter should be invstring now */
p_opt("bolt11", param_invstring, &invstring),
p_opt_def("amount_msat", param_msat, &msat, AMOUNT_MSAT(0)),
p_opt("total_amount_msat", param_msat, &total_msat),
p_opt("destination", param_node_id, &destination),
p_opt("localinvreqid", param_sha256, &local_invreq_id),
p_opt("groupid", param_u64, &group),
Expand Down Expand Up @@ -1370,7 +1371,8 @@ static struct command_result *json_sendonion(struct command *cmd,
return command_check_done(cmd);

return send_payment_core(ld, cmd, payment_hash, *partid, *group,
first_hop, *msat, AMOUNT_MSAT(0),
first_hop, *msat,
total_msat ? *total_msat : *msat,
label, invstring, description,
packet, destination, NULL, NULL,
path_secrets, local_invreq_id);
Expand Down
Loading