| 198 | } |
| 199 | |
| 200 | static fp16_t *get_capacities(const tal_t *ctx, |
| 201 | struct plugin *plugin, struct gossmap *gossmap) |
| 202 | { |
| 203 | fp16_t *caps; |
| 204 | struct gossmap_chan *c; |
| 205 | |
| 206 | caps = tal_arrz(ctx, fp16_t, gossmap_max_chan_idx(gossmap)); |
| 207 | |
| 208 | for (c = gossmap_first_chan(gossmap); |
| 209 | c; |
| 210 | c = gossmap_next_chan(gossmap, c)) { |
| 211 | struct amount_msat cap; |
| 212 | |
| 213 | cap = gossmap_chan_get_capacity(gossmap, c); |
| 214 | /* Pessimistic: round down! */ |
| 215 | caps[gossmap_chan_idx(gossmap, c)] |
| 216 | = u64_to_fp16(cap.millisatoshis/1000, false); /* Raw: fp16 */ |
| 217 | } |
| 218 | return caps; |
| 219 | } |
| 220 | |
| 221 | /* If we're the payer, we don't add delay or fee to our own outgoing |
| 222 | * channels. This wouldn't be right if we looped back through ourselves, |
no test coverage detected