You need to spend sats to create a channel to advertize your nodeid, * so creating clashes is not free: we can be lazy! */
| 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! */ |
| 43 | static 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 | } |
| 52 | HTABLE_DEFINE_NODUPS_TYPE(ptrint_t, nodeidx_id, nodeid_hash, nodeidx_eq_id, |
| 53 | nodeidx_htable); |
| 54 |
nothing calls this directly
no test coverage detected