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

Function gossmap_node_get_feature

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

1275 * * [`addrlen*byte`:`addresses`]
1276 */
1277int gossmap_node_get_feature(const struct gossmap *map,
1278 const struct gossmap_node *n,
1279 int fbit)
1280{
1281 const size_t feature_len_off = 2 + 64;
1282 size_t feature_len;
1283
1284 if (n->nann_off == 0)
1285 return -1;
1286
1287 feature_len = map_be16(map, n->nann_off + feature_len_off);
1288
1289 return map_feature_test(map, COMPULSORY_FEATURE(fbit),
1290 n->nann_off + feature_len_off + 2, feature_len);
1291}
1292
1293/* There are two 33-byte pubkeys possible: choose the one which appears
1294 * in the graph (otherwise payment will fail anyway). */

Callers 1

can_carry_onionmsgFunction · 0.85

Calls 2

map_be16Function · 0.85
map_feature_testFunction · 0.85

Tested by

no test coverage detected