MCPcopy Create free account
hub / github.com/ElementsProject/lightning / retry_data_init

Function retry_data_init

plugins/libplugin-pay.c:2474–2490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2472 struct payment *p);
2473
2474static struct retry_mod_data *
2475retry_data_init(struct payment *p)
2476{
2477 struct retry_mod_data *rdata = tal(p, struct retry_mod_data);
2478 struct retry_mod_data *parent_rdata;
2479
2480 /* We start the retry counter from scratch for the root payment, or if
2481 * the parent was split, meaning this is a new attempt with new
2482 * amounts. */
2483 if (p->parent == NULL || p->parent->step == PAYMENT_STEP_SPLIT) {
2484 rdata->retries = 10;
2485 } else {
2486 parent_rdata = payment_mod_retry_get_data(p->parent);
2487 rdata->retries = parent_rdata->retries - 1;
2488 }
2489 return rdata;
2490}
2491
2492/* Determine whether retrying could possibly succeed. Retrying in this case
2493 * means that we repeat the entire flow, including computing a new route, new

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected