Skip to content

Commit

Permalink
fix it (#5326)
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas authored Apr 7, 2020
1 parent 7e84e42 commit 5ec3706
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions beacon-chain/p2p/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ self=%s
%v
`,
s.cfg.BootstrapNodeAddr,
selfAddresses(s.host),
s.selfAddresses(),
len(s.host.Network().Peers()),
formatPeers(s.host), // Must be last. Writes one entry per row.
); err != nil {
Expand All @@ -37,10 +37,13 @@ self=%s
}

// selfAddresses formats the host data into dialable strings, comma separated.
func selfAddresses(h host.Host) string {
func (s *Service) selfAddresses() string {
var addresses []string
for _, ma := range h.Addrs() {
addresses = append(addresses, ma.String()+"/p2p/"+h.ID().Pretty())
if s.dv5Listener != nil {
addresses = append(addresses, s.dv5Listener.Self().String())
}
for _, ma := range s.host.Addrs() {
addresses = append(addresses, ma.String()+"/p2p/"+s.host.ID().Pretty())
}
return strings.Join(addresses, ",")
}
Expand Down

0 comments on commit 5ec3706

Please sign in to comment.