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

Function gossmap_node_get_feature

common/gossmap.c:1786–1800  ·  view source on GitHub ↗

BOLT #7: * 1. type: 257 (`node_announcement`) * 2. data: * * [`signature`:`signature`] * * [`u16`:`flen`] * * [`flen*byte`:`features`] * * [`u32`:`timestamp`] * * [`point`:`node_id`] * * [`3*byte`:`rgb_color`] * * [`32*byte`:`alias`] * * [`u16`:`addrlen`] * * [`addrlen*byte`:`addresses`] */

Source from the content-addressed store, hash-verified

1784 * * [`addrlen*byte`:`addresses`]
1785 */
1786int gossmap_node_get_feature(const struct gossmap *map,
1787 const struct gossmap_node *n,
1788 int fbit)
1789{
1790 const u64 feature_len_off = 2 + 64;
1791 size_t feature_len;
1792
1793 if (n->nann_off == 0)
1794 return -1;
1795
1796 feature_len = map_be16(map, n->nann_off + feature_len_off);
1797
1798 return map_feature_test(map, COMPULSORY_FEATURE(fbit),
1799 n->nann_off + feature_len_off + 2, feature_len);
1800}
1801
1802u8 *gossmap_node_get_features(const tal_t *ctx,
1803 const struct gossmap *map,

Callers 1

can_carry_onionmsgFunction · 0.85

Calls 2

map_be16Function · 0.85
map_feature_testFunction · 0.85

Tested by

no test coverage detected