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

Function gossmap_node_get_feature

common/gossmap.c:1792–1806  ·  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

1790 * * [`addrlen*byte`:`addresses`]
1791 */
1792int gossmap_node_get_feature(const struct gossmap *map,
1793 const struct gossmap_node *n,
1794 int fbit)
1795{
1796 const u64 feature_len_off = 2 + 64;
1797 size_t feature_len;
1798
1799 if (n->nann_off == 0)
1800 return -1;
1801
1802 feature_len = map_be16(map, n->nann_off + feature_len_off);
1803
1804 return map_feature_test(map, COMPULSORY_FEATURE(fbit),
1805 n->nann_off + feature_len_off + 2, feature_len);
1806}
1807
1808u8 *gossmap_node_get_features(const tal_t *ctx,
1809 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