mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-03 21:24:22 +01:00
json_listpeers returns an array of peers, and an array of nodes: the latter is a subset of the former, and is used for printing alias/color information. This changes it so there is a 1:1 correspondance between the peer information and nodes, meaning no more O(n^2) search. If there is no node_announce for a peer, we use a negative timestamp (already used to indicate that the rest of the gossip_getnodes_entry is not valid). Other fixes: 1. Use get_node instead of iterating through the node map. 2. A node without addresses is perfectly valid: we have to use the timestamp to see if the alias/color are set. Previously we wouldn't print that if it didn't also advertize an address. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>