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

Function tell_waiters_failed

lightningd/pay.c:277–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277static void tell_waiters_failed(struct lightningd *ld,
278 const struct sha256 *payment_hash,
279 const struct wallet_payment *payment,
280 enum jsonrpc_errcode pay_errcode,
281 const struct onionreply *onionreply,
282 const struct routing_failure *fail,
283 const char *details)
284{
285 struct sendpay_command *pc;
286 struct sendpay_command *next;
287 const char *errmsg =
288 sendpay_errmsg_fmt(tmpctx, pay_errcode, fail, details);
289
290 /* Careful: sendpay_fail deletes cmd */
291 list_for_each_safe(&ld->waitsendpay_commands, pc, next, list) {
292 if (!sha256_eq(payment_hash, &pc->payment_hash))
293 continue;
294 if (payment->partid != pc->partid)
295 continue;
296 if (payment->groupid != pc->groupid)
297 continue;
298
299 sendpay_fail(pc->cmd, payment, pay_errcode, onionreply, fail,
300 errmsg);
301 }
302
303 notify_sendpay_failure(ld,
304 payment,
305 pay_errcode,
306 onionreply,
307 fail,
308 errmsg);
309}
310
311static void tell_waiters_success(struct lightningd *ld,
312 const struct sha256 *payment_hash,

Callers 1

payment_failedFunction · 0.85

Calls 3

sendpay_errmsg_fmtFunction · 0.85
sendpay_failFunction · 0.85
notify_sendpay_failureFunction · 0.70

Tested by

no test coverage detected