Browse Source

mpp: Consider an abort as the payment being finished

If one part sets the root to be aborted, there is little point in continuing
to wait for the remainder, return to the caller immediately.
mpp
Christian Decker 5 years ago
parent
commit
d4dfb3e3e5
  1. 2
      plugins/libplugin-pay.c

2
plugins/libplugin-pay.c

@ -956,7 +956,7 @@ static void payment_finished(struct payment *p);
* child-spawning state and all of its children are in a final state. */ * child-spawning state and all of its children are in a final state. */
static bool payment_is_finished(const struct payment *p) static bool payment_is_finished(const struct payment *p)
{ {
if (p->step == PAYMENT_STEP_FAILED || p->step == PAYMENT_STEP_SUCCESS) if (p->step == PAYMENT_STEP_FAILED || p->step == PAYMENT_STEP_SUCCESS || p->abort)
return true; return true;
else if (p->step == PAYMENT_STEP_SPLIT || p->step == PAYMENT_STEP_RETRY) { else if (p->step == PAYMENT_STEP_SPLIT || p->step == PAYMENT_STEP_RETRY) {
bool running_children = false; bool running_children = false;

Loading…
Cancel
Save