Use node_id everywhere for nodes.

I tried to just do gossipd, but it was uncontainable, so this ended up being
a complete sweep.

We didn't get much space saving in gossipd, even though we should save
24 bytes per node.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-04-08 19:28:32 +09:30
committed by neil saitug
parent b4455d517c
commit a2fa699e0e
63 changed files with 685 additions and 578 deletions

View File

@@ -845,19 +845,16 @@ static const char *codename_noun[]
void setup_color_and_alias(struct lightningd *ld)
{
u8 der[PUBKEY_CMPR_LEN];
pubkey_to_der(der, &ld->id);
if (!ld->rgb)
/* You can't get much red by default */
ld->rgb = tal_dup_arr(ld, u8, der, 3, 0);
ld->rgb = tal_dup_arr(ld, u8, ld->id.k, 3, 0);
if (!ld->alias) {
u64 adjective, noun;
char *name;
memcpy(&adjective, der+3, sizeof(adjective));
memcpy(&noun, der+3+sizeof(adjective), sizeof(noun));
memcpy(&adjective, ld->id.k+3, sizeof(adjective));
memcpy(&noun, ld->id.k+3+sizeof(adjective), sizeof(noun));
noun %= ARRAY_SIZE(codename_noun);
adjective %= ARRAY_SIZE(codename_adjective);