Browse Source

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.
paymod-03
Christian Decker 5 years ago
parent
commit
0b85b983ac
  1. 6
      plugins/libplugin-pay.c

6
plugins/libplugin-pay.c

@ -809,6 +809,12 @@ static inline void retry_step_cb(struct retry_mod_data *rd,
{
struct payment *subpayment;
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) {
subpayment = payment_new(p, NULL, p, p->modifiers);
payment_start(subpayment);

Loading…
Cancel
Save