mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
pay/sendpay: also store description in case bolt11 uses description_hash.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -65,6 +65,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
|
||||
p->temp_exclusion = NULL;
|
||||
p->failroute_retry = false;
|
||||
p->invstring = NULL;
|
||||
p->description = NULL;
|
||||
p->routetxt = NULL;
|
||||
p->max_htlcs = UINT32_MAX;
|
||||
p->aborterror = NULL;
|
||||
@@ -1568,6 +1569,9 @@ static struct command_result *payment_createonion_success(struct command *cmd,
|
||||
/* FIXME: rename parameter to invstring */
|
||||
json_add_string(req->js, "bolt11", p->invstring);
|
||||
|
||||
if (p->description)
|
||||
json_add_string(req->js, "description", p->description);
|
||||
|
||||
if (p->destination)
|
||||
json_add_node_id(req->js, "destination", p->destination);
|
||||
|
||||
@@ -3559,6 +3563,8 @@ static void presplit_cb(struct presplit_mod_data *d, struct payment *p)
|
||||
* they'll be used when aggregating the payments
|
||||
* again. */
|
||||
c->invstring = tal_strdup(c, p->invstring);
|
||||
if (p->description)
|
||||
c->description = tal_strdup(c, p->description);
|
||||
|
||||
/* Get ~ target, but don't exceed amt */
|
||||
c->amount = fuzzed_near(target, amt);
|
||||
|
||||
Reference in New Issue
Block a user