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

Function node_id_from_pubkey

common/node_id.c:12–19  ·  view source on GitHub ↗

Convert from pubkey to compressed pubkey. */

Source from the content-addressed store, hash-verified

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

Callers 15

handle_onionFunction · 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
json_injectpaymentonionFunction · 0.85
calc_forwarding_channelFunction · 0.85
make_peer_nodeFunction · 0.85
populate_node_mapFunction · 0.85

Calls 1

abortFunction · 0.85

Tested by 7

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