MCPcopy Create free account
hub / github.com/ElementsProject/lightning / payment_abort

Function payment_abort

plugins/libplugin-pay.c:2119–2145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2117}
2118
2119void payment_abort(struct payment *p, const char *fmt, ...) {
2120 va_list ap;
2121 struct payment *root = payment_root(p);
2122 payment_set_step(p, PAYMENT_STEP_FAILED);
2123 p->end_time = time_now();
2124
2125 /* We can fail twice, it seems. */
2126 tal_free(p->failreason);
2127 va_start(ap, fmt);
2128 p->failreason = tal_vfmt(p, fmt, ap);
2129 va_end(ap);
2130
2131 root->abort = true;
2132
2133 /* Only set the abort error if it's not yet set, otherwise we
2134 * might end up clobbering the earliest and decisive failure
2135 * with less relevant ones. */
2136 if (root->aborterror == NULL)
2137 root->aborterror = tal_dup_talarr(root, char, p->failreason);
2138
2139 paymod_log(p, LOG_INFORM, "%s", p->failreason);
2140
2141 /* Do not use payment_continue, because that'd continue
2142 * applying the modifiers before calling
2143 * payment_finished(). */
2144 payment_finished(p);
2145}
2146
2147void payment_fail(struct payment *p, const char *fmt, ...)
2148{

Callers 3

keysend_cbFunction · 0.85
route_exclusions_step_cbFunction · 0.85

Calls 6

payment_rootFunction · 0.85
payment_set_stepFunction · 0.85
time_nowFunction · 0.85
tal_freeFunction · 0.85
paymod_logFunction · 0.85
payment_finishedFunction · 0.85

Tested by

no test coverage detected