| 51 | } |
| 52 | |
| 53 | bool channel_apy_sum(struct channel_apy *sum_apy, |
| 54 | const struct channel_apy *entry) |
| 55 | { |
| 56 | bool ok; |
| 57 | ok = amount_msat_accumulate(&sum_apy->routed_in, |
| 58 | entry->routed_in); |
| 59 | ok &= amount_msat_accumulate(&sum_apy->routed_out, |
| 60 | entry->routed_out); |
| 61 | ok &= amount_msat_accumulate(&sum_apy->fees_in, |
| 62 | entry->fees_in); |
| 63 | ok &= amount_msat_accumulate(&sum_apy->fees_out, |
| 64 | entry->fees_out); |
| 65 | ok &= amount_msat_accumulate(&sum_apy->push_in, |
| 66 | entry->push_in); |
| 67 | ok &= amount_msat_accumulate(&sum_apy->push_out, |
| 68 | entry->push_out); |
| 69 | ok &= amount_msat_accumulate(&sum_apy->lease_in, |
| 70 | entry->lease_in); |
| 71 | ok &= amount_msat_accumulate(&sum_apy->lease_out, |
| 72 | entry->lease_out); |
| 73 | |
| 74 | ok &= amount_msat_accumulate(&sum_apy->our_start_bal, |
| 75 | entry->our_start_bal); |
| 76 | |
| 77 | ok &= amount_msat_accumulate(&sum_apy->total_start_bal, |
| 78 | entry->total_start_bal); |
| 79 | |
| 80 | if (sum_apy->start_blockheight > entry->start_blockheight) |
| 81 | sum_apy->start_blockheight = entry->start_blockheight; |
| 82 | |
| 83 | if (sum_apy->end_blockheight < entry->end_blockheight) |
| 84 | sum_apy->end_blockheight = entry->end_blockheight; |
| 85 | |
| 86 | return ok; |
| 87 | } |
| 88 | |
| 89 | static struct account *search_account(struct account **accts, const char *acctname) |
| 90 | { |
no test coverage detected