Channels that are not in the chan_extra_map should be disabled. */
| 1571 | |
| 1572 | /* Channels that are not in the chan_extra_map should be disabled. */ |
| 1573 | static bool check_disabled(const bitmap *disabled, |
| 1574 | const struct gossmap *gossmap, |
| 1575 | const struct chan_extra_map *chan_extra_map) |
| 1576 | { |
| 1577 | assert(disabled); |
| 1578 | assert(gossmap); |
| 1579 | assert(chan_extra_map); |
| 1580 | |
| 1581 | if (tal_bytelen(disabled) != |
| 1582 | 2 * bitmap_sizeof(gossmap_max_chan_idx(gossmap))) |
| 1583 | return false; |
| 1584 | |
| 1585 | for (struct gossmap_chan *chan = gossmap_first_chan(gossmap); chan; |
| 1586 | chan = gossmap_next_chan(gossmap, chan)) { |
| 1587 | const u32 chan_idx = gossmap_chan_idx(gossmap, chan); |
| 1588 | /* If both directions are disabled anyways, there is no need to |
| 1589 | * fetch their information in chan_extra. */ |
| 1590 | if (bitmap_test_bit(disabled, chan_idx * 2 + 0) && |
| 1591 | bitmap_test_bit(disabled, chan_idx * 2 + 1)) |
| 1592 | continue; |
| 1593 | |
| 1594 | struct short_channel_id scid = gossmap_chan_scid(gossmap, chan); |
| 1595 | struct chan_extra *ce = |
| 1596 | chan_extra_map_get(chan_extra_map, scid); |
| 1597 | if (!ce) |
| 1598 | return false; |
| 1599 | } |
| 1600 | return true; |
| 1601 | } |
| 1602 | |
| 1603 | // TODO(eduardo): choose some default values for the minflow parameters |
| 1604 | /* eduardo: I think it should be clear that this module deals with linear |
no test coverage detected