MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_disabled

Function check_disabled

plugins/renepay/mcf.c:1573–1601  ·  view source on GitHub ↗

Channels that are not in the chan_extra_map should be disabled. */

Source from the content-addressed store, hash-verified

1571
1572/* Channels that are not in the chan_extra_map should be disabled. */
1573static 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

Callers 1

minflowFunction · 0.85

Calls 8

tal_bytelenFunction · 0.85
bitmap_sizeofFunction · 0.85
gossmap_max_chan_idxFunction · 0.85
gossmap_first_chanFunction · 0.85
gossmap_next_chanFunction · 0.85
gossmap_chan_idxFunction · 0.85
bitmap_test_bitFunction · 0.85
gossmap_chan_scidFunction · 0.85

Tested by

no test coverage detected