| 227 | } |
| 228 | |
| 229 | static u64 get_htlc_max(struct gossmap *gossmap, |
| 230 | const struct gossmap_chan *chan, |
| 231 | int dir) |
| 232 | { |
| 233 | struct amount_msat msat, capacity_msat; |
| 234 | |
| 235 | capacity_msat = gossmap_chan_get_capacity(gossmap, chan); |
| 236 | gossmap_chan_get_update_details(gossmap, chan, dir, |
| 237 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, &msat); |
| 238 | |
| 239 | /* Special value for the common case of "max_htlc == capacity" */ |
| 240 | if (amount_msat_eq(msat, capacity_msat)) { |
| 241 | return 0; |
| 242 | } |
| 243 | /* Other common case: "max_htlc == 99% capacity" */ |
| 244 | if (amount_msat_scale(&capacity_msat, capacity_msat, 0.99) |
| 245 | && amount_msat_eq(msat, capacity_msat)) { |
| 246 | return 1; |
| 247 | } |
| 248 | return msat.millisatoshis; /* Raw: compressed format */ |
| 249 | } |
| 250 | |
| 251 | static u64 get_basefee(struct gossmap *gossmap, |
| 252 | const struct gossmap_chan *chan, |
nothing calls this directly
no test coverage detected