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

Function node_id_from_pubkey

common/node_id.c:11–18  ·  view source on GitHub ↗

Convert from pubkey to compressed pubkey. */

Source from the content-addressed store, hash-verified

9
10/* Convert from pubkey to compressed pubkey. */
11void node_id_from_pubkey(struct node_id *id, const struct pubkey *key)
12{
13 size_t outlen = ARRAY_SIZE(id->k);
14 if (!secp256k1_ec_pubkey_serialize(secp256k1_ctx, id->k, &outlen,
15 &key->pubkey,
16 SECP256K1_EC_COMPRESSED))
17 abort();
18}
19
20WARN_UNUSED_RESULT
21bool pubkey_from_node_id(struct pubkey *key, const struct node_id *id)

Callers 13

handle_onion_messageFunction · 0.85
handshake_in_successFunction · 0.85
handshake_out_successFunction · 0.85
hsmd_initFunction · 0.85
test_wallet_outputsFunction · 0.85
test_channel_crudFunction · 0.85
json_checkmessageFunction · 0.85
bolt11_decodeFunction · 0.85
node_id_from_privkeyFunction · 0.85
path_to_nodeFunction · 0.85
node_id_from_privkeyFunction · 0.85

Calls 1

abortFunction · 0.85

Tested by 5

test_wallet_outputsFunction · 0.68
test_channel_crudFunction · 0.68
node_id_from_privkeyFunction · 0.68
node_id_from_privkeyFunction · 0.68