| 1024 | } |
| 1025 | |
| 1026 | void layer_clear_overridden_capacities(const struct layer *layer, |
| 1027 | const struct gossmap *gossmap, |
| 1028 | fp16_t *capacities) |
| 1029 | { |
| 1030 | struct constraint_hash_iter conit; |
| 1031 | struct constraint *con; |
| 1032 | |
| 1033 | for (con = constraint_hash_first(layer->constraints, &conit); |
| 1034 | con; |
| 1035 | con = constraint_hash_next(layer->constraints, &conit)) { |
| 1036 | struct gossmap_chan *c = gossmap_find_chan(gossmap, &con->scidd.scid); |
| 1037 | size_t idx; |
| 1038 | if (!c) |
| 1039 | continue; |
| 1040 | idx = gossmap_chan_idx(gossmap, c); |
| 1041 | if (idx < tal_count(capacities)) |
| 1042 | capacities[idx] = 0; |
| 1043 | } |
| 1044 | } |
| 1045 | |
| 1046 | size_t layer_trim_constraints(struct layer *layer, u64 cutoff) |
| 1047 | { |
no test coverage detected