paymod: Not having a result doesn't mean we failed at getroute
Specifically if we split, there is no result, but we shouldn't add a failure message.
This commit is contained in:
parent
b813974e13
commit
d0eb3a79eb
|
@ -2098,6 +2098,8 @@ static void presplit_cb(void *d, struct payment *p)
|
||||||
} else if (p == root && p->step == PAYMENT_STEP_INITIALIZED) {
|
} else if (p == root && p->step == PAYMENT_STEP_INITIALIZED) {
|
||||||
/* The presplitter only acts on the root and only in the first
|
/* The presplitter only acts on the root and only in the first
|
||||||
* step. */
|
* step. */
|
||||||
|
size_t count = 0;
|
||||||
|
|
||||||
/* We need to opt-in to the MPP sending facility no matter
|
/* We need to opt-in to the MPP sending facility no matter
|
||||||
* what we do. That means setting all partids to a non-zero
|
* what we do. That means setting all partids to a non-zero
|
||||||
* value. */
|
* value. */
|
||||||
|
@ -2142,8 +2144,20 @@ static void presplit_cb(void *d, struct payment *p)
|
||||||
* when splitting. */
|
* when splitting. */
|
||||||
c->constraints.fee_budget.millisatoshis *= multiplier; /* Raw: Multiplication */
|
c->constraints.fee_budget.millisatoshis *= multiplier; /* Raw: Multiplication */
|
||||||
payment_start(c);
|
payment_start(c);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
p->step = PAYMENT_STEP_SPLIT;
|
p->step = PAYMENT_STEP_SPLIT;
|
||||||
|
p->end_time = time_now();
|
||||||
|
p->why = tal_fmt(
|
||||||
|
p,
|
||||||
|
"Split into %zu sub-payments due to initial size (%s > "
|
||||||
|
"%dmsat)",
|
||||||
|
count,
|
||||||
|
type_to_string(tmpctx, struct amount_msat, &root->amount),
|
||||||
|
MPP_TARGET_SIZE);
|
||||||
|
plugin_log(p->plugin, LOG_INFORM, "%s", p->why);
|
||||||
|
p->result = NULL;
|
||||||
|
p->route = NULL;
|
||||||
}
|
}
|
||||||
payment_continue(p);
|
payment_continue(p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1512,7 +1512,9 @@ static void paystatus_add_payment(struct json_stream *s, const struct payment *p
|
||||||
/* TODO Add routehint. */
|
/* TODO Add routehint. */
|
||||||
/* TODO Add route details */
|
/* TODO Add route details */
|
||||||
|
|
||||||
if (p->result != NULL) {
|
if (p->step == PAYMENT_STEP_SPLIT) {
|
||||||
|
/* Don't add anything, this is neither a success nor a failure. */
|
||||||
|
} else if (p->result != NULL) {
|
||||||
if (p->step == PAYMENT_STEP_SUCCESS)
|
if (p->step == PAYMENT_STEP_SUCCESS)
|
||||||
json_object_start(s, "success");
|
json_object_start(s, "success");
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue