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

Function gossmap_guess_node_id

common/gossmap.c:1295–1307  ·  view source on GitHub ↗

There are two 33-byte pubkeys possible: choose the one which appears * in the graph (otherwise payment will fail anyway). */

Source from the content-addressed store, hash-verified

1293/* There are two 33-byte pubkeys possible: choose the one which appears
1294 * in the graph (otherwise payment will fail anyway). */
1295void gossmap_guess_node_id(const struct gossmap *map,
1296 const struct point32 *point32,
1297 struct node_id *id)
1298{
1299 id->k[0] = SECP256K1_TAG_PUBKEY_EVEN;
1300 secp256k1_xonly_pubkey_serialize(secp256k1_ctx,
1301 id->k + 1,
1302 &point32->pubkey);
1303
1304 /* If we don't find this, let's assume it's odd. */
1305 if (!gossmap_find_node(map, id))
1306 id->k[0] = SECP256K1_TAG_PUBKEY_ODD;
1307}

Callers 1

json_payFunction · 0.85

Calls 1

gossmap_find_nodeFunction · 0.85

Tested by

no test coverage detected