mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
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:
committed by
neil saitug
parent
b4455d517c
commit
a2fa699e0e
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user