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

Function total_sent

plugins/xpay/xpay.c:425–442  ·  view source on GitHub ↗

We total up all attempts which succeeded in the past (if we're not * in slow mode, that's only the one which just succeeded), and then we * assume any others currently-in-flight will also succeed. */

Source from the content-addressed store, hash-verified

423 * in slow mode, that's only the one which just succeeded), and then we
424 * assume any others currently-in-flight will also succeed. */
425static struct amount_msat total_sent(const struct payment *payment)
426{
427 struct amount_msat total = AMOUNT_MSAT(0);
428 const struct attempt *i;
429
430 list_for_each(&payment->past_attempts, i, list) {
431 if (!i->preimage)
432 continue;
433 if (!amount_msat_accumulate(&total, initial_sent(i)))
434 abort();
435 }
436
437 list_for_each(&payment->current_attempts, i, list) {
438 if (!amount_msat_accumulate(&total, initial_sent(i)))
439 abort();
440 }
441 return total;
442}
443
444/* Should we finish command now? */
445static bool should_finish_command(const struct payment *payment)

Callers 1

payment_succeededFunction · 0.85

Calls 3

amount_msat_accumulateFunction · 0.85
initial_sentFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected