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

Function hash_nodeid

plugins/askrene/layer.c:128–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128static size_t hash_nodeid(const struct node_id *node)
129{
130 /* Reading the key through a size_t pointer was undefined (a u8
131 * array is not a size_t), and at -O3 the load could be hoisted
132 * above the `bias->node = *node` copy in set_node_bias(), so the
133 * entry was stored under the hash of uninitialised memory and
134 * later lookups missed it. Hash the whole key instead. */
135 return siphash24(siphash_seed(), node->k, sizeof(node->k));
136}
137
138static bool bias_eq_nodeid(const struct node_bias *bias,
139 const struct node_id *node)

Callers

nothing calls this directly

Calls 2

siphash24Function · 0.85
siphash_seedClass · 0.50

Tested by

no test coverage detected