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

Function get_nodeid

common/onion_message.c:35–52  ·  view source on GitHub ↗

We can extract nodeid from ids[], but usually we can get it from the * previous next_node_id. */

Source from the content-addressed store, hash-verified

33/* We can extract nodeid from ids[], but usually we can get it from the
34 * previous next_node_id. */
35static const struct pubkey *
36get_nodeid(const struct tlv_encrypted_data_tlv **tlvs,
37 const struct pubkey *ids,
38 size_t i)
39{
40 if (i == 0)
41 return &ids[0];
42
43 if (tlvs[i-1]->next_node_id == NULL) {
44 /* If you didn't set next_node_id you have to set
45 * short_channel_id! */
46 assert(tlvs[i-1]->short_channel_id);
47 assert(i < tal_count(ids));
48 return &ids[i];
49 }
50
51 return tlvs[i-1]->next_node_id;
52}
53
54/* Stage 1: tlv_encrypted_data_tlv[] -> struct blinded_path.
55 * Optional array of node_ids, consulted iff tlv uses scid in one entry. */

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected