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

Function tell_waiters_failed

lightningd/pay.c:305–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305static void tell_waiters_failed(struct lightningd *ld,
306 const struct sha256 *payment_hash,
307 const struct wallet_payment *payment,
308 enum jsonrpc_errcode pay_errcode,
309 const struct onionreply *onionreply,
310 const struct routing_failure *fail,
311 const char *details)
312{
313 struct waitsendpay_command *pc;
314 struct waitsendpay_command *next;
315 const char *errmsg =
316 sendpay_errmsg_fmt(tmpctx, pay_errcode, fail, details);
317
318 /* Careful: ->fail deletes cmd */
319 list_for_each_safe(&ld->waitsendpay_commands, pc, next, list) {
320 if (!sha256_eq(payment_hash, &pc->payment_hash))
321 continue;
322 if (payment->partid != pc->partid)
323 continue;
324 if (payment->groupid != pc->groupid)
325 continue;
326
327 pc->fail(pc->cmd, payment, pay_errcode, onionreply, fail, errmsg, pc->arg);
328 }
329
330 notify_sendpay_failure(ld,
331 payment,
332 pay_errcode,
333 onionreply,
334 fail,
335 errmsg);
336}
337
338static void tell_waiters_success(struct lightningd *ld,
339 const struct sha256 *payment_hash,

Callers 2

payment_failedFunction · 0.85
self_paymentFunction · 0.85

Calls 3

sendpay_errmsg_fmtFunction · 0.85
failMethod · 0.80
notify_sendpay_failureFunction · 0.70

Tested by

no test coverage detected