How much did previous successes deliver? */
| 599 | |
| 600 | /* How much did previous successes deliver? */ |
| 601 | static 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. */ |
| 616 | static struct amount_msat payment_deliver(const struct payment *payment) |
no test coverage detected