mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
retrymod: Reset retry counter if parent is a split
If the parent is a split we have new payment parameters, and want to perform a number of attempts with those.
This commit is contained in:
@@ -1264,11 +1264,15 @@ retry_data_init(struct payment *p)
|
|||||||
{
|
{
|
||||||
struct retry_mod_data *rdata = tal(p, struct retry_mod_data);
|
struct retry_mod_data *rdata = tal(p, struct retry_mod_data);
|
||||||
struct retry_mod_data *parent_rdata;
|
struct retry_mod_data *parent_rdata;
|
||||||
if (p->parent != NULL) {
|
|
||||||
|
/* We start the retry counter from scratch for the root payment, or if
|
||||||
|
* the parent was split, meaning this is a new attempt with new
|
||||||
|
* amounts. */
|
||||||
|
if (p->parent == NULL || p->parent->step == PAYMENT_STEP_SPLIT) {
|
||||||
|
rdata->retries = 10;
|
||||||
|
} else {
|
||||||
parent_rdata = payment_mod_retry_get_data(p->parent);
|
parent_rdata = payment_mod_retry_get_data(p->parent);
|
||||||
rdata->retries = parent_rdata->retries - 1;
|
rdata->retries = parent_rdata->retries - 1;
|
||||||
} else {
|
|
||||||
rdata->retries = 10;
|
|
||||||
}
|
}
|
||||||
return rdata;
|
return rdata;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user