Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Nov 6, 2023
1 parent 9b9c260 commit 1bbe4c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/fullnode/peer_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ type Peer struct {

// PrivatePeer returns the full private identifier of the peer in the format <node_id>@<private_address>:<port>.
func (peer Peer) PrivatePeer() string {
return string(peer.NodeID) + "@" + peer.PrivateAddress
return peer.NodeID + "@" + peer.PrivateAddress
}

// ExternalPeer returns the full external address of the peer in the format <node_id>@<external_address>:<port>.
func (peer Peer) ExternalPeer() string {
if peer.ExternalAddress == "" {
return string(peer.NodeID) + "@" + net.JoinHostPort("0.0.0.0", strconv.Itoa(p2pPort))
return peer.NodeID + "@" + net.JoinHostPort("0.0.0.0", strconv.Itoa(p2pPort))
}
return string(peer.NodeID) + "@" + peer.ExternalAddress
return peer.NodeID + "@" + peer.ExternalAddress
}

// Peers maps an ObjectKey using the instance name to Peer.
Expand Down Expand Up @@ -74,7 +74,7 @@ func (peers Peers) HasIncompleteExternalAddress() bool {

// NodeIDs returns a sorted list of all node IDs.
func (peers Peers) NodeIDs() []string {
ids := lo.Map(lo.Values(peers), func(p Peer, _ int) string { return string(p.NodeID) })
ids := lo.Map(lo.Values(peers), func(p Peer, _ int) string { return p.NodeID })
sort.Strings(ids)
return ids
}
Expand Down

0 comments on commit 1bbe4c1

Please sign in to comment.