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

Function nodeid_hash

common/gossmap.c:43–51  ·  view source on GitHub ↗

You need to spend sats to create a channel to advertize your nodeid, * so creating clashes is not free: we can be lazy! */

Source from the content-addressed store, hash-verified

41/* You need to spend sats to create a channel to advertize your nodeid,
42 * so creating clashes is not free: we can be lazy! */
43static size_t nodeid_hash(const struct node_id id)
44{
45 size_t val;
46 size_t off = siphash_seed()->u.u8[0] % 16;
47
48 BUILD_ASSERT(15 + sizeof(val) < sizeof(id.k));
49 memcpy(&val, id.k + off, sizeof(val));
50 return val;
51}
52HTABLE_DEFINE_NODUPS_TYPE(ptrint_t, nodeidx_id, nodeid_hash, nodeidx_eq_id,
53 nodeidx_htable);
54

Callers

nothing calls this directly

Calls 1

siphash_seedClass · 0.70

Tested by

no test coverage detected