| 58 | } |
| 59 | |
| 60 | bool channel_apy_sum(struct channel_apy *sum_apy, |
| 61 | const struct channel_apy *entry) |
| 62 | { |
| 63 | bool ok; |
| 64 | ok = amount_msat_add(&sum_apy->routed_in, |
| 65 | sum_apy->routed_in, |
| 66 | entry->routed_in); |
| 67 | ok &= amount_msat_add(&sum_apy->routed_out, |
| 68 | sum_apy->routed_out, |
| 69 | entry->routed_out); |
| 70 | ok &= amount_msat_add(&sum_apy->fees_in, |
| 71 | sum_apy->fees_in, |
| 72 | entry->fees_in); |
| 73 | ok &= amount_msat_add(&sum_apy->fees_out, |
| 74 | sum_apy->fees_out, |
| 75 | entry->fees_out); |
| 76 | ok &= amount_msat_add(&sum_apy->push_in, |
| 77 | sum_apy->push_in, |
| 78 | entry->push_in); |
| 79 | ok &= amount_msat_add(&sum_apy->push_out, |
| 80 | sum_apy->push_out, |
| 81 | entry->push_out); |
| 82 | ok &= amount_msat_add(&sum_apy->lease_in, |
| 83 | sum_apy->lease_in, |
| 84 | entry->lease_in); |
| 85 | ok &= amount_msat_add(&sum_apy->lease_out, |
| 86 | sum_apy->lease_out, |
| 87 | entry->lease_out); |
| 88 | |
| 89 | ok &= amount_msat_add(&sum_apy->our_start_bal, |
| 90 | sum_apy->our_start_bal, |
| 91 | entry->our_start_bal); |
| 92 | |
| 93 | ok &= amount_msat_add(&sum_apy->total_start_bal, |
| 94 | sum_apy->total_start_bal, |
| 95 | entry->total_start_bal); |
| 96 | |
| 97 | if (sum_apy->start_blockheight > entry->start_blockheight) |
| 98 | sum_apy->start_blockheight = entry->start_blockheight; |
| 99 | |
| 100 | if (sum_apy->end_blockheight < entry->end_blockheight) |
| 101 | sum_apy->end_blockheight = entry->end_blockheight; |
| 102 | |
| 103 | return ok; |
| 104 | } |
| 105 | |
| 106 | static struct account *search_account(struct account **accts, u64 acct_id) |
| 107 | { |
no test coverage detected