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

Function payment_succeeded

lightningd/pay.c:332–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void payment_succeeded(struct lightningd *ld, struct htlc_out *hout,
333 const struct preimage *rval)
334{
335 struct wallet_payment *payment;
336
337 wallet_payment_set_status(ld->wallet, &hout->payment_hash,
338 hout->partid, hout->groupid,
339 PAYMENT_COMPLETE, rval);
340 payment = wallet_payment_by_hash(tmpctx, ld->wallet,
341 &hout->payment_hash,
342 hout->partid, hout->groupid);
343 assert(payment);
344
345 if (payment->local_offer_id)
346 wallet_offer_mark_used(ld->wallet->db, payment->local_offer_id);
347 tell_waiters_success(ld, &hout->payment_hash, payment);
348}
349
350/* Return a struct routing_failure for an immediate failure
351 * (returned directly from send_htlc_out). The returned

Callers 1

fulfill_our_htlc_outFunction · 0.70

Calls 4

wallet_payment_by_hashFunction · 0.85
wallet_offer_mark_usedFunction · 0.85
tell_waiters_successFunction · 0.85

Tested by

no test coverage detected