forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gossipd: fix json_listpeers printing node information.
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 <[email protected]>
- Loading branch information
1 parent
a9cf733
commit 7b735fb
Showing
3 changed files
with
30 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters