mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
pay: Move the chanhint update up to payment_getroute
We were delaying the channel_hint update till after the `createonion` call which gave us the same situation we had with concurrent `getroute` calls. Now we update the hints as soon as the plugins have had their say in the route construction. If we still fail, either because a modifier changed the route causing the failure, or because we interleaved the route computation for multiple parts, we reset the attempt and retry inline (i.e., without creating a new sub-payment). Notice that interleaved route computations now only happen if the modifier makes an async call to some RPC or similar.
This commit is contained in:
parent
abad494fcf
commit
83f57ac300
1 changed files with 2 additions and 2 deletions
|
@ -1364,8 +1364,6 @@ static struct command_result *payment_createonion_success(struct command *cmd,
|
|||
struct route_hop *first = &p->route[0];
|
||||
struct secret *secrets;
|
||||
|
||||
payment_chanhints_apply_route(p, false);
|
||||
|
||||
p->createonion_response = json_to_createonion_response(p, buffer, toks);
|
||||
|
||||
req = jsonrpc_request_start(p->plugin, NULL, "sendonion",
|
||||
|
@ -1486,6 +1484,8 @@ static void payment_compute_onion_payloads(struct payment *p)
|
|||
p->step = PAYMENT_STEP_ONION_PAYLOAD;
|
||||
hopcount = tal_count(p->route);
|
||||
|
||||
payment_chanhints_apply_route(p, false);
|
||||
|
||||
/* Now compute the payload we're about to pass to `createonion` */
|
||||
cr = p->createonion_request = tal(p, struct createonion_request);
|
||||
cr->assocdata = tal_arr(cr, u8, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue