common: expose node_id_hash functions.

They're used in several places, and we're about to add more.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-16 13:55:48 +10:30
committed by Alex Myers
parent 0faa8397c3
commit 6a95d3a25e
4 changed files with 22 additions and 26 deletions

View File

@@ -192,17 +192,6 @@ static struct command_result *json_getroute(struct command *cmd,
return command_finished(cmd, js);
}
static const struct node_id *node_id_keyof(const struct node_id *id)
{
return id;
}
static size_t node_id_hash(const struct node_id *id)
{
return siphash24(siphash_seed(), id->k, sizeof(id->k));
}
HTABLE_DEFINE_TYPE(struct node_id, node_id_keyof, node_id_hash, node_id_eq,
node_map);