diff --git a/lightningd/pay.c b/lightningd/pay.c index 5c3e87254..f9dc40f57 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -1179,6 +1179,7 @@ static struct command_result *json_sendonion(struct command *cmd, struct lightningd *ld = cmd->ld; const char *label, *b11str; struct secret *path_secrets; + struct amount_msat *msat; u64 *partid; if (!param(cmd, buffer, params, @@ -1189,6 +1190,7 @@ static struct command_result *json_sendonion(struct command *cmd, p_opt("shared_secrets", param_secrets_array, &path_secrets), p_opt_def("partid", param_u64, &partid, 0), p_opt("bolt11", param_string, &b11str), + p_opt_def("msatoshi", param_msat, &msat, AMOUNT_MSAT(0)), NULL)) return command_param_failed(); @@ -1201,7 +1203,7 @@ static struct command_result *json_sendonion(struct command *cmd, failcode); return send_payment_core(ld, cmd, payment_hash, *partid, - first_hop, AMOUNT_MSAT(0), AMOUNT_MSAT(0), + first_hop, *msat, AMOUNT_MSAT(0), label, b11str, &packet, NULL, NULL, NULL, path_secrets); } diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index cc43c421b..965fff5cf 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -1029,6 +1029,7 @@ static struct command_result *payment_createonion_success(struct command *cmd, json_object_end(req->js); json_add_sha256(req->js, "payment_hash", p->payment_hash); + json_add_amount_msat_only(req->js, "msatoshi", p->amount); json_array_start(req->js, "shared_secrets"); secrets = p->createonion_response->shared_secrets;