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

Function total_delivered

plugins/xpay/xpay.c:601–613  ·  view source on GitHub ↗

How much did previous successes deliver? */

Source from the content-addressed store, hash-verified

599
600/* How much did previous successes deliver? */
601static struct amount_msat total_delivered(const struct payment *payment)
602{
603 struct amount_msat sum = AMOUNT_MSAT(0);
604 struct attempt *attempt;
605
606 list_for_each(&payment->past_attempts, attempt, list) {
607 if (!attempt->preimage)
608 continue;
609 if (!amount_msat_accumulate(&sum, attempt_deliver(attempt)))
610 abort();
611 }
612 return sum;
613}
614
615/* This payment should deliver this amount. */
616static struct amount_msat payment_deliver(const struct payment *payment)

Callers 1

Calls 3

amount_msat_accumulateFunction · 0.85
attempt_deliverFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected