mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugins/libplugin-pay.c: Propagate local_id from parent to child payment object.
This commit is contained in:
committed by
Christian Decker
parent
d8678467fa
commit
6468616c02
@@ -50,6 +50,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
|
|||||||
|
|
||||||
p->invoice = parent->invoice;
|
p->invoice = parent->invoice;
|
||||||
p->id = parent->id;
|
p->id = parent->id;
|
||||||
|
p->local_id = parent->local_id;
|
||||||
} else {
|
} else {
|
||||||
assert(cmd != NULL);
|
assert(cmd != NULL);
|
||||||
p->partid = 0;
|
p->partid = 0;
|
||||||
@@ -58,6 +59,8 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
|
|||||||
p->channel_hints = tal_arr(p, struct channel_hint, 0);
|
p->channel_hints = tal_arr(p, struct channel_hint, 0);
|
||||||
p->excluded_nodes = tal_arr(p, struct node_id, 0);
|
p->excluded_nodes = tal_arr(p, struct node_id, 0);
|
||||||
p->id = next_id++;
|
p->id = next_id++;
|
||||||
|
/* Caller must set this. */
|
||||||
|
p->local_id = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize all modifier data so we can point to the fields when
|
/* Initialize all modifier data so we can point to the fields when
|
||||||
@@ -219,6 +222,11 @@ static struct command_result *payment_getinfo_success(struct command *cmd,
|
|||||||
void payment_start(struct payment *p)
|
void payment_start(struct payment *p)
|
||||||
{
|
{
|
||||||
struct payment *root = payment_root(p);
|
struct payment *root = payment_root(p);
|
||||||
|
|
||||||
|
/* Should have been set in root payment, or propagated from root
|
||||||
|
* payment to all child payments. */
|
||||||
|
assert(p->local_id);
|
||||||
|
|
||||||
p->step = PAYMENT_STEP_INITIALIZED;
|
p->step = PAYMENT_STEP_INITIALIZED;
|
||||||
p->current_modifier = -1;
|
p->current_modifier = -1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user