paymod: Add reason why a payment was attempted

This is a slight change in interface in that the string no longer spells out
that a specific node was excluded.
This commit is contained in:
Christian Decker
2020-05-29 17:08:20 +02:00
parent 3a35dd34ac
commit 2f0e535b81
4 changed files with 15 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
p->start_time = time_now();
p->result = NULL;
p->getroute_cltv = DEFAULT_FINAL_CLTV_DELTA;
p->why = NULL;
/* Copy over the relevant pieces of information. */
if (parent != NULL) {
@@ -1144,6 +1145,9 @@ static inline void retry_step_cb(struct retry_mod_data *rd,
subpayment = payment_new(p, NULL, p, p->modifiers);
payment_start(subpayment);
p->step = PAYMENT_STEP_RETRY;
subpayment->why =
tal_fmt(subpayment, "Still have %d attempts left",
rdata->retries - 1);
}
payment_continue(p);