Show the IP address on the end of each connection

This commit is contained in:
Bryan Boreham committed 2014-09-15 17:50:04 +01:00
1 parent bd45c7212f
commit 464a1c8246
1 file changed
+2 -2
+2 -2
View File
@@ -105,8 +105,8 @@ func (cache *PeerCache) String() string {
var buf bytes.Buffer
cache.ForEach(func(name PeerName, peer *Peer) {
buf.WriteString(fmt.Sprint(peer, "\n"))
peer.ForEachConnection(func(remoteName PeerName, _ Connection) {
buf.WriteString(fmt.Sprintf(" -> %v\n", remoteName))
peer.ForEachConnection(func(remoteName PeerName, conn Connection) {
buf.WriteString(fmt.Sprintf(" -> %v [%v]\n", remoteName, conn.RemoteTCPAddr()))
})
})
return buf.String()