mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
paymod: Teach the retry_mod not to insist when it's futile
An important life lesson: if there is no path to happiness, then trying harder will still not get you there.
This commit is contained in:
parent
10f231bcb5
commit
0b85b983ac
@ -809,6 +809,12 @@ static inline void retry_step_cb(struct retry_mod_data *rd,
|
|||||||
{
|
{
|
||||||
struct payment *subpayment;
|
struct payment *subpayment;
|
||||||
struct retry_mod_data *rdata = payment_mod_retry_get_data(p);
|
struct retry_mod_data *rdata = payment_mod_retry_get_data(p);
|
||||||
|
|
||||||
|
/* If we failed to find a route, it's unlikely we can suddenly find a
|
||||||
|
* new one without any other changes, so it's time to give up. */
|
||||||
|
if (p->step == PAYMENT_STEP_FAILED && p->route == NULL)
|
||||||
|
payment_continue(p);
|
||||||
|
|
||||||
if (p->step == PAYMENT_STEP_FAILED && rdata->retries > 0) {
|
if (p->step == PAYMENT_STEP_FAILED && rdata->retries > 0) {
|
||||||
subpayment = payment_new(p, NULL, p, p->modifiers);
|
subpayment = payment_new(p, NULL, p, p->modifiers);
|
||||||
payment_start(subpayment);
|
payment_start(subpayment);
|
||||||
|
Loading…
Reference in New Issue
Block a user