| 130 | } |
| 131 | |
| 132 | void reserve_sub(const struct reserve_htable *reserved, |
| 133 | const struct short_channel_id_dir *scidd, |
| 134 | const struct layer **layers, |
| 135 | struct amount_msat *amount) |
| 136 | { |
| 137 | struct reserve *r; |
| 138 | struct reserve_htable_iter rit; |
| 139 | |
| 140 | for (r = reserve_htable_getfirst(reserved, scidd, &rit); |
| 141 | r; |
| 142 | r = reserve_htable_getnext(reserved, scidd, &rit)) { |
| 143 | if (r->rhop.layer && !layer_in(r->rhop.layer, layers)) |
| 144 | continue; |
| 145 | if (!amount_msat_deduct(amount, r->rhop.amount)) |
| 146 | *amount = AMOUNT_MSAT(0); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | bool reserve_accumulate(const struct reserve_htable *reserved, |
| 151 | const struct short_channel_id_dir *scidd, |
no test coverage detected