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

Function payment_abort

plugins/libplugin-pay.c:2412–2438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2410}
2411
2412struct command_result *payment_abort(struct payment *p, enum jsonrpc_errcode code, const char *fmt, ...) {
2413 va_list ap;
2414 struct payment *root = payment_root(p);
2415 payment_set_step(p, PAYMENT_STEP_FAILED);
2416 p->end_time = clock_time();
2417
2418 /* We can fail twice, it seems. */
2419 tal_free(p->failreason);
2420 va_start(ap, fmt);
2421 p->failreason = tal_vfmt(p, fmt, ap);
2422 va_end(ap);
2423
2424 root->abort = true;
2425
2426 /* Only set the abort error if it's not yet set, otherwise we
2427 * might end up clobbering the earliest and decisive failure
2428 * with less relevant ones. */
2429 if (root->aborterror == NULL)
2430 root->aborterror = tal_dup_talarr(root, char, p->failreason);
2431
2432 paymod_log(p, LOG_INFORM, "%s", p->failreason);
2433
2434 /* Do not use payment_continue, because that'd continue
2435 * applying the modifiers before calling
2436 * payment_finished(). */
2437 return payment_finished(p);
2438}
2439
2440struct command_result *payment_fail(struct payment *p, const char *fmt, ...)
2441{

Callers 4

keysend_cbFunction · 0.85
route_exclusions_step_cbFunction · 0.85

Calls 6

payment_rootFunction · 0.85
payment_set_stepFunction · 0.85
clock_timeFunction · 0.85
tal_freeFunction · 0.85
paymod_logFunction · 0.85
payment_finishedFunction · 0.85

Tested by

no test coverage detected