paymod: Add a human readable failreason to payments

This makes it easier to stash a human readable failure message in an attempt.
This commit is contained in:
Christian Decker
2020-06-09 15:38:16 +02:00
parent 2ef130e427
commit 030633bb28
2 changed files with 28 additions and 18 deletions

View File

@@ -258,6 +258,9 @@ struct payment {
const char *why;
const char *label;
/* Human readable explanation of why this payment failed. */
const char *failreason;
};
struct payment_modifier {
@@ -342,7 +345,8 @@ void payment_start(struct payment *p);
void payment_continue(struct payment *p);
/* Fails a partial payment and continues with the core flow. */
void payment_fail(struct payment *p);
void payment_fail(struct payment *p, const char *fmt, ...) PRINTF_FMT(2,3);
struct payment *payment_root(struct payment *p);
struct payment_tree_result payment_collect_result(struct payment *p);