Skip to content

Commit

Permalink
peers number count fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tj327 committed Mar 6, 2024
1 parent f8eb2ab commit 8d849f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tasks/node_discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ func NodeDiscover(rpcAddr string, isLog bool) {
peers := peersFromIP[ipAddr]
for _, peer := range peers {
nodeInfo.Peers = append(nodeInfo.Peers, string(peer.NodeInfo.ID()))
nodeInfo.PeersNumber = int64(len(nodeInfo.Peers))

ip, _ := getHostname(peer.NodeInfo.ListenAddr)
if isPrivateIP(ip) {
Expand All @@ -537,6 +538,7 @@ func NodeDiscover(rpcAddr string, isLog bool) {
privNodeInfo.Port, _ = getPort(peer.NodeInfo.ListenAddr)
privNodeInfo.Peers = []string{}
privNodeInfo.Peers = append(privNodeInfo.Peers, nodeInfo.ID)
privNodeInfo.PeersNumber = int64(len(privNodeInfo.Peers))
privNodeInfo.Alive = true
privNodeInfo.Synced = nodeInfo.Synced
privNodeInfo.BlockHeightAtSync = nodeInfo.BlockHeightAtSync
Expand Down

0 comments on commit 8d849f9

Please sign in to comment.