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

Function payment_succeeded

lightningd/pay.c:359–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359void payment_succeeded(struct lightningd *ld,
360 const struct sha256 *payment_hash,
361 u64 partid, u64 groupid,
362 const struct preimage *rval)
363{
364 struct wallet_payment *payment;
365
366 wallet_payment_set_status(ld->wallet, payment_hash,
367 partid, groupid,
368 PAYMENT_COMPLETE, rval);
369 payment = wallet_payment_by_hash(tmpctx, ld->wallet,
370 payment_hash,
371 partid, groupid);
372 assert(payment);
373
374 if (payment->local_invreq_id)
375 wallet_invoice_request_mark_used(ld->wallet->db,
376 payment->local_invreq_id);
377 tell_waiters_success(ld, payment_hash, payment);
378}
379
380/* Return a struct routing_failure for an immediate failure
381 * (returned directly from send_htlc_out). The returned

Callers 3

self_paymentFunction · 0.70
selfpay_mpp_succeededFunction · 0.70
fulfill_our_htlc_outFunction · 0.70

Calls 4

wallet_payment_by_hashFunction · 0.85
tell_waiters_successFunction · 0.85

Tested by

no test coverage detected